C examples for Data Type:enum
Here's how you could define the Weekday type so that the enumerator values start from 1:
The enumerators Monday through Sunday will correspond to values 1 through 7.
#include <stdio.h> int main(void) { enum Weekday {Monday = 1, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}; enum Weekday today = Wednesday; /*w ww .j ava 2 s .co m*/ printf("Weekday created\n"); printf("%d\n",today); return 0; }