I'm trying to understand this code below but Xcode is giving me an error at the 2nd to last line saying "Thread 1: signal SIGABRT"
char string1[4] = "abc";
char string2[4] = "def";
printf("%s \n%s\n", string1, string2);
strcpy(string1, string1+1); // Xcode points here, "Thread 1: signal SIGABRT"
printf("%s \n%s", string1, string2);
What's going on ? I expected it to print
abc
def
bc
def
but it obviously stops halfway through.