Q: I just tried the code
char *p; strcpy(p, "abc");and it worked. How? Why didn't it crash?
A: You got lucky, I guess. The memory randomly pointed to by the uninitialized pointer p happened to be writable by you, and apparently was not already in use for anything vital. See also question 11.35.
Additional links: longer explanation, another longer explanation