Char and strcpy in C
问题 I came across a part of question in which, I am getting an output, but I need a explanation why it is true and does work? char arr[4]; strcpy(arr,"This is a link"); printf("%s",arr); When I compile and execute, I get the following output. Output: This is a link 回答1: The short answer why it worked (that time) is -- you got lucky. Writing beyond the end of an array is undefined behavior . Where undefined behavior is just that, undefined , it could just a easily cause a segmentation fault as it