Also, consider if you want to adopt some form of convention for your type identifiers. E.g., type_t, Type, or something else. I find this especially handy when documenting code.
For example, if I say "screen_t", then I am referring to a datatype (that, perhaps, describes the contents of a "real" screen). If, instead, the data type and the "object" that it represents share the same name, then you have no easy way of indicating which you are talking/writing about.
N
Nobody
This code is erroneous; not because anything is being "redefined" but because you don't give a name after the type. It should be e.g.:
The first option allows you to write declarations as "struct pixel p;", the second as "pixel_t p;", the last two using either form.
Here, "pixel" is a struct tag while "pixel_t" is a typedef. They exist in separate namespaces. A struct tag can only appear following the "struct" keyword, i.e. as "struct pixel".
B
braden nelson
oh, thanks for the help! il fix that
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.