The program is:
#include #include int main(void) { char *a=\"abc\",*ptr; ptr=a; ptr++; *ptr=\'k\'; printf(\"
The reason is that your string "abc" lives in a read-only area of memory. It gets put there by the linker. You try to change it in your program, and all bets are off.
"abc"