- 3
- 0
- 约1.5万字
- 约 34页
- 2019-06-17 发布于山东
- 举报
* * * * * 示例 main() { enum color{red,green,blue,white}; enum color fc; clrscr(); printf(请输入色号:); scanf(%d,fc); switch (fc) { case red:printf(红色!);break; case green:printf(绿色!);break; case blue:printf(蓝色!);break; case white:printf(白色!);break; default:printf(其他颜色!); } } 9.11 用typedef定义类型 功能:用自定义名字为已有数据类型命名 类型定义简单形式: typedef type name; 例 typedef int INTEGER; 类型定义语句关键字 已有数据类型名 用户定义的类型名 例 typedef float REAL; 类型定义后,与已有类型一样使用 例 INTEGER a,b,c; REAL f1,f2; int a,b,c; float f1,f2; 说
原创力文档

文档评论(0)