Hi,
is it the case that there's no a standard way of zero initializing struct that is guaranteed to work on all compiler implementations for C?
Series use this form:
I get error if I use that syntax in C compiling with cl. So I use following syntax:
But can this type of initializing bite me in the future? Would it be safer to memset the struct each time? Maybe even create a small macro for it? Something along these line.
| #define NEW(type, name) type name; memset(&name, 0, sizeof(type));
|
One could create new structs like this then:
Is there some good practice you would recommend to follow?
Thanks,
Vjekoslav