Initializing array of structs
I'm having a problem initializing members of a struct array. That being said, the problem could very well be before the initialization. I'm still new, so bear with me!
Here's the relevant pieces of code. Names changed to protect the guilty.
Code:
struct Thing {
int mem1;
int mem2;
int mem3;
int mem4;
};
struct Thing *things;
void SomeFunc(void) {
extern struct Thing *things;
things = malloc(sizeof(struct Thing) * 33);
/* ...check return of malloc, exit if needed, etc... */
things[0] = {1, 1, 0, 0};
/* ...etc...*/
}
The error I get is "syntax error before '{' token", which is comforting in that it assures me I'm just doing something dumb. Hopefully it's at least clear what I'm trying to do!
Thanks! :)