When you enter a string in a C++ program like that, it doesn't copy it, it merely sets the location to where in memory your program has been loaded to (plus a little bit). In order to avoid invalidating the pointer and orphaning the previous data, you need to use strcpy:

Code:
strcpy(dest_pointer, "My String is X");
This way, you change the data, not the pointer.

BTW - if you're already using STL, take a look at the string class, which is incredibly powerful, and fairly fast. It also handles reallocation properly.