// 26_26-6.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <iostream>
#include <windows.h>

using namespace std;

class XYpos {
private:
	int x, y;
public:
	XYpos(int n1 = 0, int n2 = 0) { x = n1; y = n2; }
	void disp() { cout << "(" << x << "," << y << ")\n"; }
	XYpos &operator++();
	XYpos operator++(int);
};

XYpos &XYpos::operator ++()
{
	++x;
	++y;
	return *this;
}

XYpos XYpos::operator ++(int)
{
	XYpos wk = *this;
	++x;
	++y;
	return wk;
}

int _tmain(int argc, _TCHAR* argv[])
{
	XYpos d1(100, 200), d2(100, 200), d3, d4;
	d3 = ++d1;
	d3.disp();
	d1.disp();

	d4 = d2++;
	d4.disp();
	d2.disp();


	MessageBox(NULL, _T("Check Console Window"), L"MessageBox", MB_OK);

	return 0;
}

