Question: i have some doubts regarding character pointers:

1.when we write the declaration:

```
char *t;

```

do we need to do 

```
t=new char[6];
strcpy(t,"terry");

```

or directly 

```
 t="terry";

```

will do..

2.Also if we follow do

```
char *t;
t=new char[6];
t="terry";

```

will t now point to the allocated memory from heap or the first letter of terry(if we look from the point of view of manipulation of pointers).

3.if i write:

```
char *t;

```

and then i have to initialise 't' to '\0'(but t should point to an allocated memory space)..how do i do this because my mvc 2010 compiler doesnt allow...

```
t=new char[5](0);//0 is the ascii value of '\0'

```

Answer: 
You're tagged C++. Use string:

`std::string t("terry");` and let the language take care of the details for you.

1. Either way will do, depending on your needs. If you need to change the string later you have to allocate the memory, and when you allocate always remember to delete it later.
2. The first letter of the literal.
3. `t=new char[5]; t[0] = 0;`
1. You shoudn't do the second, because `t` is `char*`, and so `t="terry"` is deprecated (and your compiler might give this warning indicating the assignment statement.)
2. The allocated memory is leaked, since you didn't use it, and `t` points to `terry`. Again, this is deprecated (and your compiler might give this warning indicating the assignment statement).
3. Just do : `t = new char[5]();` It's default initialized now.

As the best practice, in general is, `std::string`. So use it:

```
std::string t = "terry";

```

No memory leak, no deprecated feature, no warning. No tension.