Plastic: Inta = 0;
Character type: char a = 0;;
Array:
int a[20];
memset( a,0,sizeof(int)* 20);
C string only needs to set the first character to' \0'.
Of course, it can also be completely cleared.
char a[20]= " ashdfuih ";
memset( a,0,sizeof(char)* 20);
For example, there is a structure Some x, which can be cleared like this:
memset(& amp; X, 0, sizeof (some));
If it is an array structure with some x[ 10], it can be like this:
menset( x,0,sizeof(Some)* 10);
Any pointer can be made null by directly assigning it to 0:
Some * p = 0;;