一、枚举的定义方法:
1、直接定义:
(1)为了以后定义,这里只是声明
enum DAY { MON=1, TUE, WED, THU, FRI, SAT, SUN };
enum DAY { MON=1, TUE, WED, THU, FRI, SAT, SUN }today;
enum { MON=1, TUE, WED, THU, FRI, SAT, SUN }today;
(1)
typedef enum DAY { MON=1, TUE, WED, THU, FRI, SAT, SUN }EVERYDAY;(2)去掉DAY
typedef enum { MON=1, TUE, WED, THU, FRI, SAT, SUN }EVERYDAY;
1、enum DAY tomorrow = MON;
2、enum DAY tomorrow;
tomorrow = MON;