Enums
From Suhrid.net Wiki
Jump to navigationJump to search
- Enums are a feature that allows a variable to be restricted to having only a few predefined values.
- e.g. if we want to restrict a variable that represents t-shirt sizes to only one of four possible sizes, we can use an enum:
enum TShirtSize {
S,
M,
L,
XL
};