jeudi 21 septembre 2017

C99 Enum - Need Clarification

I have reviewed this but the accepted answer doesn't make sense to me. I should be able to define an enum in C99 as

enum WeekDays
{
    MON, TUES, WED, THURS, FRI, SAT, SUN
}days;

and utilize the enum as follows in main as

days = FRI;
if (days == FRI)
{
    printf("Thank God it's Friday!");
}

Why the additional work in the accepted answer to utilize the enum?

Aucun commentaire:

Enregistrer un commentaire