MSVC++ enum underlying type
- by bobobobo
MSDN has
enum [tag] [: type] {enum-list} [declarator]; // for definition of enumerated type
SO it looks like you can specify the type of an enum in MSVC++, but it doesn't seem to work for me:
// want "underlying type" of this enum to be char.
enum MyCharEnum : char
{
Val1 ='A',
Val2 ='B',
Val9 ='X'
} ;