我正在研究Xcode 5.1.1并且我在一个应该完美运行的C文件中出错。
typedef enum {NO = 0, YES = 1} EnBool;
! Expected '}'
调试器专注于第一个大括号,它就像它不需要它,而后面有一个枚举。
答案 0 :(得分:2)
NO
和YES
是Objective C
中的关键字(实际上是宏),您不能将它们用作枚举标签。
它在objc.h
中定义,它的实现如下:
使用任何其他标签,如:
typedef enum {nothing = 0, something = 1} EnBool;