Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Can I put pointer variables in enumeration types in C? If so, how can I express it?
Can I put pointer variables in enumeration types in C? If so, how can I express it?
The names in curly brackets in enumeration variables are defined by the compiler itself, not variables ~ just plastic numbers, which cannot be changed.

Such as enum{a, b, c}. The corresponding values of a, b and c are 0, 1, 2.

Of course, it can also be initialized, such as enum{a=3, b, c, d=7, e}. The corresponding values of a, b, c, d and e are 3, 4, 5, 7 and 8 respectively. (Note: Values cannot be duplicated! )

Since it is not a variable, of course, you can't put a pointer variable ~

It should be noted that you can write casually with curly braces, but you can't use integers!