enum
The enum keyword defines set of constants of type char or type int depending on the range of values of the set. It is used as follows:
enum « tag » {name « = value », ...};
Where
| tag | is the name of the enum set. |
| name | is the name of an enum constant. |
| value | is the value to assign to the constant. If the value is missing, then it is assumed to be the value of the previous constant in the set + 1. The default value for the first constant in the list is 0. |
Define an enum type in your program as follows:
enum tag name « = value »;
Where
| tag | is the name of the enum set. |
| name | is the name of the variable. |
| value | is the value to assign to the variable. |
Refer to 1-Byte Scalars or 2-Byte Scalars for information regarding the format of enum constants.