If I want to implement the following code, are enums allowed?
Not describing alternatives in too much detail - Yes.
how would I start initializing an enumeration?
I usually declare an enumeration in C like this:
typedef enum MONDayOfWeek {
MONDayOfWeek_Undefined = 0,
MONDayOfWeek_Monday,
MONDayOfWeek_Tuesday,
MONDayOfWeek_Wednesday,
MONDayOfWeek_Thursday,
MONDayOfWeek_Friday,
MONDayOfWeek_Saturday,
MONDayOfWeek_Sunday
} MONDayOfWeek;
MONDayOfWeek day = MONDayOfWeek_Monday;
MONwill be your library or organization prefix. DayOfWeekwill be the name of the enumeration in the library, then the values will be added.
, .
?
, , , .