If I have an enum
that does not assign numbers to the enumerations, will it's ordinal value be 0? For example:
enum enumeration { ZERO,
ONE,
TWO,
THREE,
FOUR,
FIVE,
SIX,
SEVEN,
EIGHT,
NINE };
I've been able to find a post citing that the C99 standard requires a 0 ordinal number. But I know C++ ignores several things in the C99 standard. And I've also been able to find a post witnessing the compiler using an ordinal value of 1, something I also seem recall seeing, though I can't say how long ago that was.
I would really like to see an answer that confirms this for C++, but I'd also like to know if an ordinal 0 holds even if I specify a value in the middle of an enum
:
enum enumeration { ZERO,
ONE,
TWO,
THREE = 13,
FOUR,
FIVE,
SIX,
SEVEN,
EIGHT,
NINE };