Consider the following code.
#include <stdio.h> int main() /* ww w . j a v a2s . co m*/ { char *sample = "this is a test?\n"; while(putchar(*sample++)) ; return(0); }
The string that's displayed is created by initializing a pointer.
Anytime you use a pointer to directly declare a string, the pointer variable can't be manipulated or else the string is lost.