In your code:
char *p="abc";
p points to a string literal - you are not allowed to change string literals, which is what your call to strcpy is trying to do. Instead, make p an array:
char p[] = "abc";
which will copy the literal into something that you are allowed to modify.