#include <iostream> using namespace std; int main() { int a = 3; int* p = &a;//一级指针,定义了一个指针指向这个变量 int** z=&p; //定义了一个二级指针指向p指针 cout <<"a = " << a <<endl; cout <<"*&a = " << (*&a) <<endl; // *&放在一起相当于没有或抵消 cout << "*p = "<<(*p)<<endl; cout<<"-------------------------------"<< endl; cout << "p = "<< p <<endl;//p指向a的地址,即p == &a,所以*p == *&a == a cout << "&a =" << (&a) <<endl;//a的地址 cout << "&p = " <<(&p) <<endl;//p的地址 cout <<"z = " <<z <<endl; cout << "*z = " << (*z) <<endl; cout << "**z =" <<(**z) <<endl; return 0; }