Hello,
compiling with gcc C99
I have been using enums for a while now. However, I am using some sample code to develop my application. And I came across some code like this. I have been informed this is the best practice use when using enums. But I don't see how this has any advantages.
typedef enum {
TYPE_DATE,
TYPE_TIME,
TYPE_MONEY,
TYPE_COUNT,
TYPE_UNKNOWN = TYPE_COUNT
} string_type_e;
Why have the type_count and why assign type_count to type_unknown?
Many thanks for any suggestions,