VS学习之指针
#include <iostream>
#define LOG(x) std::cout<<x<<std::endl;
int main()
{
int a = 5;
LOG(a);
//定义指针b表示a的地址
int* b = &a;
LOG(b);
//ref就是a
int &ref = a;
LOG(ref);
ref = 3;
LOG(a);
std::cin.get();
}
显示结果
5
0000004C53AFFBE4
5
3