I attempted to make a struct declaration static (so it can only be used within the files):
static typedef struct
{
int foo;
} MyStruct;
static MyStruct[5];
(This is in test_struct.c)
When I compiled the thing, I got this error:
test_struct.c:12: multiple storage classes in declaration of `MyStruct'
I figured if I remove the static before typedef struct ..., it’ll work, but what should I do if I really want to make the struct declaration static?
Thanks
You can declare variables as static.
I usually do it like this,