显示布尔类型枚举值的问题。我正在使用的这本书让我感到胆大妄为的沸腾。
虽然我可以定义它:
enum class WeekDays : bool { Mon = true, Tues = true, Wed = true, Thurs = true, Fri = true, Sat = false, Sun = false };
我不确定如何在int main()函数下显示它并多次尝试无效。然而,我可以使用其他枚举,并了解他们正在做什么,例如:
enum class Suit{Clubs = 1, Diamonds = 2, Hearts = 3, Spades = 4};
int main(array<System::String ^> ^args)
{
Suit suit = Suit::Clubs;
int value = safe_cast<int>(suit);
Console::WriteLine(L"Suit is {0} and the value is {1} ", suit, value);