// 25_25-7.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <iostream>
#include <windows.h>

using namespace std;

class XYdata {
private:
	int x, y;
public:
	XYdata() { x = 0; y = 0; }
	explicit XYdata(int n) { x = n; y = 0; }
	XYdata(int n1, int n2) { x = n1; y = n2; }
	void disp() { cout << "x=" << x << " y=" << y << '\n'; }
};

void myfunc(XYdata dt)
{
	cout << "-----myfunc-disp\n";
	dt.disp();
}

int _tmain(int argc, _TCHAR* argv[])
{
	XYdata d1(100);
	XYdata d2 = 200;	// explicit宣言したので、この行でエラーが出ます。
	XYdata d3, d4;

	d3 = XYdata(300);
	d4 = 400;

	d1.disp();
	d2.disp();
	d3.disp();

	myfunc(d1);
	myfunc(500);

	MessageBox(NULL, _T("Check Console Window"), L"MessageBox", MB_OK);

	return 0;
}

