Home > Back-end >  All say array shape of participant degenerate into pointer I how do not degenerate
All say array shape of participant degenerate into pointer I how do not degenerate

Time:09-20

CodePudding user response:

Try the sizeof (array) and sizeof (parameters)
In memory is 0 at the end of the string, strlen is to 0, the array name first address (string) as a parameter calculation is the same,

CodePudding user response:

Array is quite possible that an arbitrary element 0, use strlen judgment array length to wrongdoing,

CodePudding user response:

reference 1st floor u010165006 response:
try sizeof (array) and sizeof (parameters)
At the end of the string in memory is 0, strlen is 0, array name first address (string) as a parameter calculation is the same,

Sizeof is indeed, as before said degraded but I tried you said strlen to zero as a result of the new problems

CodePudding user response:

The integer 0, that is, '\ 0' character, '0' character of ASCII value is not zero,

CodePudding user response:

You can put a character as integer output, you can see its ASCII value,

CodePudding user response:

for(int i=0; i<256; I++)
Printf (" % c ", I);
Can output the ASCII value of 0 ~ 255 characters, some of them are control characters or invisible characters,
  • Related