Possible Duplicate:
What is the size of an enum in C?
Regrading the C language enumerations: users have no control over size of enumeration variables. Can someone explain this?
Possible Duplicate:
What is the size of an enum in C?
Regrading the C language enumerations: users have no control over size of enumeration variables. Can someone explain this?
This statement is from C99 6.7.2.2p4
Each enumerated type shall be compatible with char, a signed integer type, or an unsigned integer type. The choice of type is implementation-defined,108) but shall be capable of representing the values of all the members of the enumeration.
108) An implementation may delay the choice of which integer type until all enumeration constants have been seen.
This allows the compiler to make what it believes to be the best choice for a particular enumeration. An enumeration is probably not the best choice to use in a binary message passed between machines. But, you can use an integer type, and cast back to the enumerated type.