enum枚举类型的定义
2015-04-23 20:56
218 查看
enum枚举类型的定义方式与某种用法
#include <iostream> using namespace std; int main() { enum TOT{ zero, one, two, three, four, five };//0,1,2,3,4,5 TOT to1; to1 = five; switch (to1) { case 0:cout << "zero\n"; break; case 1:cout << "one\n"; break; case 2:cout << "two\n"; break; case 3:cout << "three\n"; break; case 4:cout << "four\n"; break; case 5:cout << "five\n"; break; default:cout << "数值错误\n"; break; } system("pause"); return 0; }
相关文章推荐
- 枚举类型enum
- 深入浅出J2SE 5.0 枚举类型(aka Enum>)
- hibernate的两个特殊注解@Transienth和@Enumerated(EnumType.STRING)和@Table(name="_teacher"),忽略,定义枚举,定义表名
- Asp.Net 将枚举类型(enum)绑定到ListControl(DropDownList)控件
- C/C++中枚举类型(enum)
- 枚举类型Enum
- 枚举类型(enum)
- java枚举类型enum的使用
- 枚举类型的定义
- c中枚举类型enum, struct, union
- Java 枚举类型(java.lang.Enum)
- C语言--enum,typedef enum 枚举类型详解
- C语言enum枚举类型解析
- 把ADO类导出为DLL时碰到enum”类型重定义 的问题
- C++中enum枚举类型成员重名问题的解决方法 - Enum枚举类型的类封装(转)
- 在用enum定义错误码时, 最好显式赋值
- Java Enum 枚举类型
- 【C#】枚举类型Enum与状态设计模式
- day6 多态--抽象类、接口、instanceof static、final 枚举类型enum
- c和verilog的enum枚举类型