Does anyone know the size of an enum?
If i have
enum foo
{
YES,
NO,
MAYBE
};
is that 1 byte, but if i had 10 enumerations would that be 2 bytes, and so on? Thanks.
Does anyone know the size of an enum?
If i have
enum foo
{
YES,
NO,
MAYBE
};
is that 1 byte, but if i had 10 enumerations would that be 2 bytes, and so on? Thanks.
>Does anyone know the size of an enum?
std::cout<< sizeof ( foo ) <<'\n';
>is that 1 byte, but if i had 10 enumerations would that be 2 bytes, and so on?
The number of constants doesn't change the size of the enum.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.