How do I access the an element in an enumeration by the associated number in C?

Advertisements I have an enumeration in C as follows: enum menu { PASTA, PIZZA, DIET_COKE, MOJITO, }; Since I haven’t explicitly mentioned the integer values corresponding to these elements, they are assigned values 0,1,2, and 3 respectively. Say I decide to add another 100 or so items to my enum. Then is there a way… Read More How do I access the an element in an enumeration by the associated number in C?