// 3_3-9.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <iostream>
#include <windows.h>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	/* 列挙定数の値 */
	enum Color {RED, BLUE, GREEN = 5, YELLOW};
	cout << "RED=" << RED << '\n';
	cout << "BLUE=" << BLUE << '\n';
	cout << "GREEN=" << GREEN << '\n';
	cout << "YELLOW=" << YELLOW << "\n\n";

	/* 列挙定数の利用 */
	Color c;
	int n;
	//c = 2;	// C++ではエラー
	c = static_cast<Color>(2);	// C++ではキャストすればOK
	c = BLUE;
	cout << "c=" << c << '\n';
	n = BLUE;
	cout << "n=" << n << "\n\n";

	MessageBox(NULL, _T("Check Console Window"), L"MessageBox", MB_OK);

	return 0;
}

