开发者

Enum values from non-integer literals?

Is it possible in C to declare enum value开发者_运维技巧s from anything other than integer literals?


No. enums are constants with type int.

Just a small addition: http://en.wikipedia.org/wiki/Enumerated_type#C_and_syntactically_similar_languages


Any expression that is composed of integer literals in the broad sense (343, 'a', L'ß') other enum, and sizeof expressions.

I am not so sure but maybe also offsetof expressions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜