Skip to content
Discussion options

You must be logged in to vote

This has to do the the differences between C++ and C. C++ wanted to do away with 'ceremonial' type stuff like this.

In C, the struct definition and type tags are treated separately. Struct only defines a struct tag. This has to be used explicitly in each reference unless you also add a typedef.

It is also now, a little too late. Since, if C were to modernize and remove this verbosity, it could now break a bunch of old C code that uses this verbose syntax.
Imagine some C code referencing struct V2 everywhere in the codebase. So, this was kept to keep new C standards backwards compatible.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by btgvesta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants