指向指针的指针的应用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/deeplan_1994/article/details/82462082
#include <iostream>
#include <stdio.h>
using namespace std;

int main(void)
{
	int a = 10;
	int *p = &a;
	int **p1 = &p;

	cout << "a的地址:" << &a << endl << endl;;

	cout << "p指针变量所保存的地址" << p << endl;
	cout << "p指针的地址:"<<&p << endl;
	cout << "p指针变量所保存地址对应的变量"<<*p << endl<<endl;

	cout << "p1指针变量所保存的内容" << p1 << endl;
	cout << "p1指针变量的地址:"<<&p1 << endl;
	cout << "p1指针指针变量所保存的地址所指的内容:"<<*p1 << endl;
}

猜你喜欢

转载自blog.csdn.net/deeplan_1994/article/details/82462082