??? 04/30/07 17:16 Modified: 04/30/07 17:19 Read: times Msg Score: +1 +1 Informative |
#138323 - Enumeration type vs. constant Responding to: ???'s previous message |
Neil Kurzman said:
So the old int rule still applies. And regarding both the old and new rules, a distinction is made between an enumerated type and an enumeration constant. The type shall be compatible with an integer type (note the lack of explicit 'int'); the choice of type is implementation-defined. The identifiers declared as enumeration constants are type 'int'. This distinction allows for an enumeration type to be a type narrower than 'int' if the all the enumerated constants fall into the range the narrower type can represent, if the implementation chooses. Not picking up on the distinction is where the enums-are-ints confusion comes from. |
Topic | Author | Date |
Quick C enumerated types question | 01/01/70 00:00 | |
Not to worry i've found out anyway. | 01/01/70 00:00 | |
What's a "quick C" | 01/01/70 00:00 | |
The answer was..... | 01/01/70 00:00 | |
not really | 01/01/70 00:00 | |
as has been discussed before | 01/01/70 00:00 | |
of course not | 01/01/70 00:00 | |
Not true | 01/01/70 00:00 | |
C99 says | 01/01/70 00:00 | |
more details | 01/01/70 00:00 | |
OK | 01/01/70 00:00 | |
not any more | 01/01/70 00:00 | |
In C99 | 01/01/70 00:00 | |
Enumeration type vs. constant | 01/01/70 00:00 | |
Thanks for that everyone | 01/01/70 00:00 |