I am trying to assign a single inside char *ptr and then print the changed value. But it is giving segmentation fault. But don't see the issue if the same is declared as ptr[32] instead of *ptr;
int main () {
char *ptr = "abcdefghijklm";
ptr[2] = "q";
printf("%s",ptr);
}
Any guess what is going wrong here?