-
If the typedef is visible, that's fine -- you just need to call it "configurationOptions" (since that's the name you gave it in the typedef) instead of "struct configurationsOptions".
Edit to add: At this point, I would say, if you have most of your code referring to "struct configurationOptions" to not typedef it but make it a named struct; if it's just a few mentions, go ahead and change those mentions. There's no advantage either way (typedef vs. named struct), so do whatever causes the least amount of typing at this point.
-
Anonymous means it simply doesn't have a name - nothing more.
Again, remove the "struct" keyword because there is no struct named configurationsOptions. There is only something named configurationsOptions.
As long as you have a full declaration of the struct, you can do a sizeof on it.
-
Many thanks - all clear now and code working :)
-
I wouldn't recommend typedef'ing it the same as the struct name,
I tend to do, along with a lot of other people
Code:
typedef struct name_s
{
} name_t;
That way you know, name_t is a type, and name_s is a struct.
-
Note that there's nothing actually wrong with using the same name for the structure as you do for the typedef, it's just rather confusing. :)