I am confused when should I add the trailing _t
to typedef
'ed types?
For example, should I do this:
typedef struct image image_t;
or this:
typedef struct image image;
What are the general rules?
Another example, should I do this:
typdef enum { ARRAY_CLOSED, ARRAY_OPEN, ARRAY_HALFOPEN } array_type_t;
or this:
typdef enum { ARRAY_CLOSED, ARRAY_OPEN, ARRAY_HALFOPEN } array_type;
Please enlighten me.
Thanks, Boda Cydo.
In POSIX, names ending with _t
are reserved, so if you are targeting a POSIX system (e.g., Linux), you should not end your types with _t
.