Possible Duplicate:
Is it possible to modify a string of char in C?
char *s = "anusha";
Is this like a constant pointer? When i tried to change the character in location 3 by writing s[3]='k', it gave me a segmentation fault. So i am assuming it is like pointing to a constant array or s is a constant pointer? Which among the two? Please clarify.
That is correct, you are not allowed to modify string literals.
However, it’s legal to do this:
The difference here being that it is stored as a local array that can be modified.