n.a will be 0;Code:struct some_struct{ int a; }; some_struct n = {};
I know this braces form of initialization is inherited from C and is supported for compatibility with C programs, but this only compiles with C++, not with the C compiler. I'm using Visual C++ 2005.
In C this type of initialization
is correct and will zero-initialize all members of a structure.Code:some_struct n = {0};
Is the empty pair of braces form of initialization standard? Because I've never seen it before, but seem to be used in winapi.



LinkBack URL
About LinkBacks



CornedBee
