Is ther a way to use the names of the struct-members for initial a const instance
typedef struct {
int i1;
int i2;
int i3;
} info_t;
//- GCC
const info_t info = {
.i1 = 1,
.i2 = 2
}
//- VS
const info_t info = {1,2,0);
the GCC allows this handy way but Visual Studio causes a error C2143 "Syntax error: missing } before."... GCC also allows to omit members (see example: info.t3 is not set)
Does anyone know a easy way to produce compatible and easy to read code with a workaround for VS?