Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Enumeration is a set of named integer constants, and integer values cannot be directly assigned to enumeration types. What should I say if I need type conversion?
Enumeration is a set of named integer constants, and integer values cannot be directly assigned to enumeration types. What should I say if I need type conversion?
The value range of enumeration type variables is limited to those integer constants when defining enumeration types, and cannot cross this range;

Although there are always some integers in the numerical value equal to the enumeration value, the types are different;

Different types of data cannot be directly assigned to each other (strictly typed languages will not pass in the compilation stage);

If necessary, tell the compiler clearly, that is, use forced type conversion for cast, so that the compiler will not do any extra checking, and the programmer will be responsible for the problems.