J
Jake Montgomery
It is my understanding the the c++ standard guarantees that an
incomplete initializer will initialize all the remaining elements to 0.
I have seen the following form, and was wondering is there was any good
reason to avoid it?
int main()
{
struct foo {
int sizeOfThisStruct;
int x;
int y;};
foo myfoo = {sizeof(foo)}; // sets the sizeOfThisStruct member and
//zeros the rest in one line.
}
incomplete initializer will initialize all the remaining elements to 0.
I have seen the following form, and was wondering is there was any good
reason to avoid it?
int main()
{
struct foo {
int sizeOfThisStruct;
int x;
int y;};
foo myfoo = {sizeof(foo)}; // sets the sizeOfThisStruct member and
//zeros the rest in one line.
}