Possible Duplicate:
Why does char* cause undefined behaviour while char[] doesn’t?
The following code
int main() {
char * st = "abc";
*st = 'z';
return 0;
}
is returning a segmentation fault. If the strings on the stack are not modifiable why is it not giving the error at compile time?