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 can do the latter option, but the pointer will most likely point to a read-only memory region, so you should only do that with a `const char *`.
2. In this case, t will ultimately point to a read-only memory region, leaking those 6 bytes.
3. You can use the `memset()` function to set a whole array to 0.

But yes, use `std::string` instead and stop thinking about this.