March 2018
Intermediate to advanced
183 pages
2h 34m
English
An enum is a user-defined type consisting of a fixed list of named constants. In the following example, the enumeration type is called Color and it contains three constants: Red, Green, and Blue.
The Color type can be used to create variables that may hold one of these constant values.
Enum constants may be prefixed with the enum name for added clarity. However, these constants are always unscoped, so care must be taken to avoid naming conflicts.
The switch statement provides a good example of ...