
// 27_27-3.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <iostream>
#include <windows.h>

using namespace std;

// -----基底クラス-----
class ClsX {
protected:
	int x;
public:
	ClsX(int n = 0) { x = n; }
	void dispX() { cout << "x=" << x << '\n'; }
};

// -----派生クラス-----
class ClsXY : public ClsX {
private:
	int y;
public:
	ClsXY(int n1 = 0, int n2 = 0) { x = n1; y = n2; }
	void dispXY() { cout << "x=" << x << " y=" << y << '\n'; }
};

int _tmain(int argc, _TCHAR* argv[])
{
	ClsXY a(10, 20);
	a.dispXY();

	MessageBox(NULL, _T("Check Console Window"), L"MessageBox", MB_OK);

	return 0;
}

