Hello people!
I need some clarification on a behaviour. I have this code:
This compiles fine and all, but I am not sure why. My "theory" is that "OTHER" is a string which is somewhere allocated, and then p points to it. This complies with the const char* type since it does not alter the "pointee", rather it points to another object all together!Code:const char *p = "TEST\n";
p = "OTHER";
printf("%s", p);
Is that correct?