enum

1 enum num{one,two,three,four,five};
2 enum a{100,two,200,four}

输出结果:

one=0;two=1;three=2;four=3;five=4;

two=101;four=201;

 

怎样进行赋值操作呢?

1 num number;
2 number=four;

枚举类型的作用是:增强程序的可读性


这可真是基础呢!!嘿嘿

posted @ 2011-12-24 09:03  CBDoctor  阅读(348)  评论(0编辑  收藏  举报