难以理解的指针变量
#include "iostream.h"int main()
{
int i=3;
int *iptr=&i;
int **iptrptr=&iptr;
cout<<"Address of Var i="<<iptr<<endl;
cout<<"Data of Var i="<<*iptr<<endl;
cout<<"Address of pointer iptr="<<iptrptr<<endl;
cout<<"Address of Var i="<<*iptrptr<<endl;
cout<<**iptrptr;
*iptr=2+*iptr;
cout<<"Data of Var i="<<*iptr<<endl;
return 0;
}
运行结果:
Address of Var i=0x0012FF7C
Data of Var i=3
Address of pointer iptr=0x0012FF78
Address of Var i=0x0012FF7C
3Data of Var i=5
Press any key to continue