#include <iostream>
using namespace std;

void func(){
	cout << "Hello World!" << endl;
}

int main(){
	{
		int i;
		int *p = &i;
		
		cout << "변수 i의 주소: &i = " << &i << endl;
		cout << "포인터 p의 값: p = " << p << endl;
		cout << "포인터 p의 주소: &p = " << &p << endl;
	}
	
	cout << "====" << endl;
	
	{
		void (*ptr)() = func;
		cout << "함수 func의 주소: &func = " << reinterpret_cast<const void *>(&func) << endl;
		cout << "함수 func의 주소 (다른 방법): func = " << reinterpret_cast<const void *>(func) << endl;
		cout << "포인터 ptr의 값: ptr = " << reinterpret_cast<const void *>(ptr) << endl;
		cout << "포인터 ptr의 주소: &ptr = " << &ptr << endl;
	}
	return 0;
}