C examples for Data Type:enum
With an enumeration, you define a new integer type where variables of the type have a fixed range of possible values.
Here's an example of a statement that defines an enumeration type with the name Weekday:
#include <stdio.h> int main(void) { enum Weekday {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}; /*from w w w . j av a2s.c o m*/ printf("Weekday created"); return 0; }