/
#include <iostream>
using namespace std;
void main(){
int num=50;
int &ref = num;
ref+=10;
cout<<"num="<<num<<endl;
cout<<"ref="<<ref<<endl;
num+=40;
cout<<"num="<<num<<endl;
cout<<"ref="<<ref<<endl;
}
//int &ref =num;
//int& ref = num;
//int & ref =num;三种定义方式引用
//引用与原变量具有相同的地址 一旦被初始化后不能被修改
//对指针变量的引用:int *a; int*&p = a;
//p是a的引用