int main()
{
char * a = "hello";
char ** b = &a;
cout <<"a指向的值:"<<*a<<endl;
cout <<"a的值: "<<(int*)a<<endl;
cout <<"a的地址: "<<&a<<endl;
cout <<"b的值: "<<b<<endl;
cout <<"b指向的值:"<<(int*)*b<<endl;
cout <<"b的地址: "<<&b<<endl;
cout <<"a+1: "<<(int*)(a+1)<<endl;
cout <<"b+1: "<<(b+1)<<endl;
return 0;
}
输出:
b+1对32位的机子增加4字节,64位的机子增加8字节。
a的地址 = b的值
b指向的值 = a的值