Char and strcpy in C

后端 未结 5 1552
耶瑟儿~
耶瑟儿~ 2021-01-29 14:48

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 li         


        
5条回答
  •  醉梦人生
    2021-01-29 15:00

    Your code has some memory issues (buffer overrun) . The function strcpy copies bytes until the null character. The function printf prints until the null character.

提交回复
热议问题