Consider this definition:
char *pmessage = \"now is the time\";
As I see it, pmessage will point to a contiguous area in the memory contain
When you write: char *pmessage = "now is the time";
The compiler treats it as if you wrote:
const char internalstring[] = "now is the time";
char *pmessage = internalstring;
The reason why you cannot modify the string, is because if you were to write:
char *pmessage1 = "now is the time";
char *pmessage2 = "now is the time";
The compiler will treat it as if you wrote:
const char internalstring[] = "now is the time";
char *pmessage1 = internalstring;
char *pmessage2 = internalstring;
So, if you were to change one, you'd change both.