Enumerations (enum)
Discover how enumerations improve code readability and efficiency.
1
Enumerations in C
An enumeration (enum) is a user-defined data type that assigns names to a set of integer values.
In this lesson, you will learn:
- How to define and use enumerations.
- How
enumimproves code readability. - How to assign custom values to enumeration constants.

2
What is an Enumeration?
Enumerations assign names to a set of integer constants.
Example declaration:
enum Color {RED, GREEN, BLUE};
By default, RED is 0, GREEN is 1, and BLUE is 2.
All lessons in this course
- Defining and Using Structures
- Unions and Memory Efficiency
- Enumerations (enum)