Enumerations are types whose values are symbolic names. These names have underlying integral values. To declare an enumeration type, we use the following syntax:
enum MyEnumName { Some_Enum_Name1, Some_Enum_Name2 };
We give the enum a name and then provide a list of enumerator names inside the curly braces. These names are also called enumerators or enumeration constants. The first enumerator has an underlying value of 0. The subsequent enumerators have the value of 2, 3, ... To declare an enum type and a variable ...