Possible Duplicate:
What is the difference between char s[] and char *s in C?
I initialize a char
pointer:
char *a="test";
I have read at some places that this is considered read-only and that it's dangerous.
Does that imply that the "test"
is not allocated space in the heap? Does that mean that the string "test" can be written over later in the program?
---Expanding my question---
If I have initiliazed a
as above and then I do a bunch of other initializations like:
int b=20;
char c[]="blahblahblah";
Can "test" in memory get overwritten with "20" or "blah"? Or does that scenario have no ground?