C language enum constant

Enumeration is a collection of elements of the collection (enumeration member) Some integer constant is named, comma, separated between the elements.
Enumeration constants defined format:

Enumeration enum {name = value enumeration, enumeration name = value, ...} enumeration name = value;


May not be assigned, he would default increments from 0
enum enumeration name (the name of the enumeration, enumeration name, the name of the enumeration, enumeration name)

He enumeration constants can be understood as #define
whenever the definition of the name as an enumeration enum #define name value


If you want a value increments, so you can in the first enumeration name assignment, the assignment will be followed from the first name of the enumeration constant increments
enum enumeration name (name = value enumeration, enumeration name enumeration names, enumeration names)

Guess you like

Origin blog.csdn.net/u013594490/article/details/93777031