In C, all enums are int integers of time, which explains why sizeof(Days) == 4 for you.
To find out how many values ββare in enum , you can do something like this:
enum Days { saturday, sunday, monday, tuesday, wednesday, thursday, friday, NUM_DAYS };
Then NUM_DAYS will be the number of transfers in Days .
Note that this will not work if you change the enumeration values, for example:
enum Foo { bar = 5, NUM_FOO };
In the above listing, NUM_FOO will be 6 .
Some programmer dude
source share