定义和初始化

枚举

enum Season {
    Summer, Fall, Winter, Spring
};

enum Season summer = Summer;
enum Season winter = Winter;
//summer is 0
//winter is 2

//the members live in the common scope: Summer, not Season.Summer,
//so two enums can't have members with the same name

printf("summer is %d\n", summer);
printf("winter is %d\n", winter);