Timeline for How to use enums in C safely?
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 4, 2014 at 11:42 | vote | accept | Michael | ||
Apr 4, 2014 at 10:45 | comment | added | user541686 |
@Sefi: You would do enum {First,Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Last} Day; and then check if First < day && day < Last .
|
|
Apr 4, 2014 at 9:56 | comment | added | Michael | But if you check day >=0 && day <=6 and then change your enum to Sunday=7... , your code won't works. | |
Apr 4, 2014 at 9:45 | history | answered | user541686 | CC BY-SA 3.0 |