Suppose I have some legacy code which cannot be changed unless a bug is discovered, and it contains this code:
bool data[32];
memset(data, 0, sizeof(data));
Is this a safe way to set all bool
in the array to a false
value?
More generally, is it safe to memset
a bool
to 0
in order to make its value false
?
Is it guaranteed to work on all compilers? Or do I to request a fix?
See Question&Answers more detail:os