定义一个星期的枚举,并取周二的值
enum Day{
MONDAY=1,
TUESDAY,
WEDNESDAY,
THURSDAY,
FRIDAY,
SATURDAY,
SUNDAY,
};
enum Day a = MONDAY;
enum Day b = TUESDAY;
enum Day c = WEDNESDAY;
enum Day d = THURSDAY;
enum Day e= FRIDAY;
enum Day f = SATURDAY;
enum Day g = SUNDAY;
printf("TUESDAY=%d\n",b);
|
|