Enumeration type is a basic data type rather than a construction data type in some computer programming languages such as C# or C++, Java and VB, but it is a construction data type in computer programming languages such as C to declare a set of named constants. A variable can be defined as an enumeration type when it has several possible values.
Enumeration can create new types of variables based on any data type of integer, long integer, short integer or byte. This variable can be set to one of the defined groups, effectively preventing users from providing invalid values. This variable can make the code clearer because it can describe a specific value.
Extended data
Precautions:
1, color of assignment operation: = red; Note that the types are consistent and cannot be crossed;
2. relational operation IF
3. The values of input enumeration variables can only be obtained by assignment statement, not by READ statement;
4. The output can't directly output the enumerated elements with the WRITE statement, and the system will think it is a..
5. Undefined variable name; Must be assigned to an enumeration variable and then output to the value of the variable;
Baidu encyclopedia-enumeration