Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to judge whether the elements in an array are empty or 0 in C language?
How to judge whether the elements in an array are empty or 0 in C language?
NULL means empty, which means nothing.

When you set an array for the first time, the elements in the array are of the array type you defined, and the values are uncertain.

For example: charch [4];

Now it's a random value, just like wk _ Wang Kui's answer.

memset(ch,' 0 ',sizeof(char)* 4); At this time, the value in ch is' 0' of character type.