i wrote a small prog :
1 #include 2 main(){ 3 char* str = \"string\"; 4 *str = \'k\'; 5 printf(\"str
char* str = "string";
This puts the string in read-only memory. It is undefined behavior (usually unpleasant behavior) when you try to modify it with the next line. Try something like
char str[] = "string";
instead.