I am trying to assign the pointer y to pointer x, *x = *y but it crashes if testChar is pointer.
char *testChar = "abc";
char *x = testChar;
char *y = testChar + 1;
char temp;
temp = *x;
*x = *y;
*y = temp;
If I change the code as char testChar[] instead of *testchar its working good. Could any one explain me the differences?