Sizeof(char[]) in C

后端 未结 8 1789
情深已故
情深已故 2021-01-17 18:15

Consider this code:

 char name[]=\"123\";
 char name1[]=\"1234\";

And this result

The size of name (char[]):4
The size of n         


        
8条回答
  •  野的像风
    2021-01-17 18:51

    Every string is terminated with the char nullbyte '\0' which add 1 to your length.

提交回复
热议问题