关于地址的理解 C++

#include <iostream>
using namespace std;
int main(){

int a=7;
int* ptr;
ptr=&a;
cout<<&a<<endl;//如果不用using namespace std;  cout会不识别
cout<<"ptr is "<<ptr<<endl;
cout<<"&ptr is "<<&ptr<<endl;//ptr指针的地址
cout<<"*&ptr is "<<*&ptr<<endl;//取出某个地址中的内容  这个内容就是ptr的内容 也就是a的地址
//把地址当做房间号  *表示得到房间号的内容
}

//得到的结果
//001FFA00
//ptr is 001FFA00
//&ptr is 001FF9F4
//*&ptr is 001FFA00
原文地址:https://www.cnblogs.com/cart55free99/p/3354293.html