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 sizeOfThisStruc t;
int x;
int y;};
foo myfoo = {sizeof(foo)}; // sets the sizeOfThisStruc t 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 sizeOfThisStruc t;
int x;
int y;};
foo myfoo = {sizeof(foo)}; // sets the sizeOfThisStruc t member and
//zeros the rest in one line.
}
Comment