// 28_28-5.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <iostream>
#include <windows.h>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	int dt = 0, n;
	int *p = &dt, *p2;

	//n = static_cast<int>(p);
	n = reinterpret_cast<int>(p);
	cout << hex;
	cout << "p=" << p << '\n';
	cout << "n=" << n << '\n';

	//p2 = static_cast<int*>(n);
	p2 = reinterpret_cast<int*>(n);
	cout << "p2=" << p2 << '\n';

	//p2 = static_cast<int*>(0x1234);
	p2 = reinterpret_cast<int*>(0x1234);
	cout << "p2=" << p2 << '\n';

	MessageBox(NULL, _T("Check Console Window"), L"MessageBox", MB_OK);

	return 0;
}

