I see that i cannot overwrite the "Hello World" like it is read only. "Hello World"
is like a constant but I don't want to. I never declare char const *MyString so
why I cannot directly change a char with my pointer CharPtr ?
I just want to know how I can do it with pointers.
No array or string solution please
Expand|Select|Wrap|Line Numbers
- char *MyString= "Hello World";
- char *CharPtr;
- CharPtr= MyString;
- *CharPtr='m';
- CharPtr++;
- *CharPtr='o';
- cout<<MyString;
Chris3000