枚举声明存在于不适当的上下文中。
An enumeration declaration exists in an inappropriate context.
只允许在主程序块、类、包或函数内部使用枚举声明。
Enumeration declarations are allowed only in the main program block, inside classes, inside packages, or in functions.
在常量表达式,比如枚举型常量、位域的宽度或是静态变量的初始值,是不允许使用在这种声明中的。
Embedded statements are not allowed in constant expressions, such as the value of an enumeration constant, the width of a bit-field, or the initial value of a static variable.
例如,如果语句以一个与“enum”(声明一个枚举)相应的标记作为开始,CDT解析器会试图将该语句同enum语句的抽象模型匹配起来。
For example, if a statement starts with a token corresponding to "enum" (declaring an enumeration), the CDT parser will try to match the statement to its abstract model of an enum statement.
请注意,默认情况下,如果声明中未设置第一个枚举成员的值,则其值为零。
Note that, by default, if the value of the first enumeration member is not set in the declaration, its value is zero.
类、类成员或枚举在声明它们的包内任何地方都可见。
Class, class member, or enumeration is visible everywhere within the package in which it is declared.
在其自己的声明中重新定义了类、结构、联合或枚举。
A class, structure, union, or enumeration is redefined in its own declaration.
讨论枚举的声明和行为中的更改。
你需要声明枚举函数之前,在全球范围(即。
You need to declare your enum before any of your functions, in the global scope (ie. outside of any function).
你需要声明枚举函数之前,在全球范围(即。
You need to declare your enum before any of your functions, in the global scope (ie. outside of any function).
应用推荐