A enum type is basically a array on constant elements that you can assign to words a integer value.
To give a example, lets say that you have a different type of car
enum cars { VAUX, FORD, LAND }; |
which in turn mean that VAX = 0 and FORD = 1 and LAND = 2, arrays start from 0 of course.
So you can use the code as
enum cars car = VAUX; if (car == VAUX) printf("Vauxhall car\n"); |
which would make more sense than saying
int car = 0; if (car == 0) printf("Vauxhall car\n"); |