

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 2
click for more info
Not enough gems
Cost: 6 gems
1: Enums
incomplete
2: Non-Default Values
incomplete
3: Switch Case
incomplete
4: Sizeof Enum
incomplete
This lesson's interactive features are locked, please to keep using them
Sometimes, you don't just want to enumerate some names (where the underlying integer constant values don't really matter)... you want to set those enumerations to specific values. For example, you might want to define a program's exit status codes:
typedef enum {
EXIT_SUCCESS = 0,
EXIT_FAILURE = 1,
EXIT_COMMAND_NOT_FOUND = 127,
} ExitStatus;
Alternatively, you can define the first value and let the compiler fill in the rest (incrementing by 1):
typedef enum {
LANE_WPM = 200,
PRIME_WPM, // 201
TEEJ_WPM, // 202
} WordsPerMinute;
Update your Color enum to the following values: