#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int i = 123;
int *px = &i;
cout << "整型变量 i 的地址是: "
<< "&i = " << &i
<< endl
<< endl
<< "指针变量 px 的地址是: "
<< "&px = " << &px
<< endl
<< endl
<< "指针变量 px 的值是,即 i 的地址: "
<< "px = " << px
<< endl
<< endl;
int **pt=&px;
cout << "**pt=&px 详解: "
<< endl
<< endl
<< "首先: &px,即取得 px 的地址: " << &px
<< endl
<< "然后: 把地址: " << &px << " 赋给 pt"
<< endl
<< "那么**pt 中的 *pt 即是指向地址 " << &px
<< endl
<< "而 px 的地址是一个指针, 而且存放了变量 i 的地址: "
<< &i
<< endl
<< "所以会有: "
<< endl
<< "pt = " << pt
<< endl
<< "*pt = " << *pt
<< endl
<< "**pt = " << **pt
<< endl;
cin.get();
return 0;
}