3 ms·
Is it better to fully qualify structs and unions or to hide their names by typedefs? I frequently see people hide all struct types because it's visual clutter a
by muricula 11y ago
Is it better to fully qualify structs and unions or to hide their names by typedefs? I frequently see people hide all struct types because it's visual clutter and extra typing.
In other words, given some struct a, should I do:
typedef struct a a_t;
I realize this is a bit of a style question, but I'm curious.
- rcfox 11y agoWhichever way you go, you should not append _t to the end of the name. That's reserved by POSIX. http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02_02 http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2...