枚举-增加BOOL类型

 1 #include <stdio.h>
 2 /*
 3 题目:c 语言中没有 bool 类型,可以通过 enum 类型来枚举。
 4 */
 5 typedef enum BOOLEN
 6 {
 7     False, True
 8 }BOOL;
 9 int main(void)
10 {
11     BOOL a = True;
12     printf("%d\n",a);
13     a = False;
14     printf("%d\n",a);
15 
16     return 0;
17 }

 

posted on 2018-09-19 14:36  王朝马汉  阅读(748)  评论(0编辑  收藏  举报

导航