I thought by setting the first element to a null would clear the entire contents of a char array.
char my_custom_data[40] = "Hello!";
my_custom_data[0] = '';
However, this only sets the first element to null.
or
my_custom_data[0] = 0;
rather than use memset
, I thought the 2 examples above should clear all the data.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…