Apperently in C99 you can simply initialize a statically allocated struct in this way
struct sometype {
int a;
double b;
};
sometype a = {
.a = 0;
};
Well, this does not apply to a struct on heap like this.
struct sometype *a = malloc(sizeof(struct sometype));
*a = {
.a = 0;
};
With GCC 4.9.2, the compiler complained
error: expected expression before '{' token
I know this is silly, but is there any syntax or technical reason that I cannot do this?