Enumerations are types whose values have 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 enum a name, and then we 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 of that type, we write: