enum en_SpeedMode{SP_Fast , SP_Slow };
чему равно sizeof(en_SpeedMode);
Здравствуйте, icWasya, Вы писали:
W>W>enum en_SpeedMode{SP_Fast , SP_Slow };
W>
W>чему равно sizeof(en_SpeedMode);
sizeof( int )
Здравствуйте, icWasya, Вы писали:
W>W>enum en_SpeedMode{SP_Fast , SP_Slow };
W>
W>чему равно sizeof(en_SpeedMode);
Стандарт:
7.2 Enumeration declarations
...
6 The underlying type of an enumeration is an integral type that can represent all the enumerator values defined in the enumeration.
If no integral type can represent all the enumerator values, the enumeration is ill-formed. It is implementation defined
which integral type is used as the underlying type for an enumeration except that the underlying type shall not
be larger than int unless the value of an enumerator cannot fit in an int or unsigned int. If the enumerator-list
is empty, the underlying type is as if the enumeration had a single enumerator with value 0. The value of sizeof()
applied to an enumeration type, an object of enumeration type, or an enumerator, is the value of sizeof() applied to
the underlying type.
В-общем implementation-defined.
It is always bad to give advices, but you will be never forgiven for a good one.
Oscar Wilde
Здравствуйте, icWasya, Вы писали:
W>W>enum en_SpeedMode{SP_Fast , SP_Slow };
W>
W>чему равно sizeof(en_SpeedMode);
7.2/5
The underlying type of an enumeration is an integral type that can represent all
the enumerator values defined in the enumeration. It is implementation-defined
which integral type is used as the underlying type for an enumeration except
that the underlying type shall not be larger than int unless the value of an
enumerator cannot fit in an int or unsigned int. If the enumerator-list is empty,
the underlying type is as if the enumeration had a single enumerator with value 0.
The value of sizeof() applied to an enumeration type, an object of enumeration type,
or an enumerator, is the value of sizeof() applied to the underlying type.
Здравствуйте, icWasya, Вы писали:
W>W>enum en_SpeedMode{SP_Fast , SP_Slow };
W>
W>чему равно sizeof(en_SpeedMode);
sizeof (int) =)
зы. любитель заманухи кидать? =)))
... << RSDN@Home 1.1.4 stable SR1 rev. 568>>