When {0} is used to initialize an object, what does it mean? I can\'t find any references to {0} anywhere, and because of the curly braces Google s
One thing to be aware of is that this technique will not set padding bytes to zero. For example:
struct foo
{
char c;
int i;
};
foo a = {0};
Is not the same as:
foo a;
memset(&a,0,sizeof(a));
In the first case, pad bytes between c and i are uninitialized. Why would you care? Well, if you're saving this data to disk or sending it over a network or whatever, you could have a security issue.