There is no benefit in user code, it’s just ugly. In the second example, the HuffCode_ isn’t even necessary since the struct type is already named by the typedef.
The only places where this can be useful are:
- When
StructNameis already in use,StructName_gives a different name (but you should really come up with a better name). - Identifiers in the C standard library that are not defined by the standard shouldn’t conflict with user code identifiers. Therefore, C library writers use the
_prefix in the hopes that users will not use that. Unfortunately, some users do. - In very old compilers, it may be useful to give the
structa different name than is used in thetypedef. You need both thetypedefand the other name if you’re building a linked structure (example).