C++如何将指针初始化为一个地址

#include < iostream>
int main()
{
using namespace std;
int higgens = 5;
int* pt = &higgens;

cout << "Value of higgens = " << higgens <<
	";Address of higgens = " << &higgens << endl;
cout << "Value of *pt = " << *pt <<
	";Value of pt = " << pt << endl;
	return 0;

}

输出:
Value of higgens = 5;Address of higgens = 012FF84C
Value of *pt = 5;Value of pt = 012FF84C

猜你喜欢

转载自blog.csdn.net/weixin_40378974/article/details/89434350
今日推荐