Any reasons for the below mentioned behavior?? i use gcc .
I think both should have run sucessfully.
Code:/* this gives segmentation fault */ #include <stdio.h> main(){ char* a = "abcd"; a[1] = '\0'; }Code:/* this doesn't give segmentation fault */ #include <stdio.h> main(){ char a[] = "abcd"; a[1] = '\0'; }