引用是一种复合类型,通过在变量名前添加“&”符号来定义。

引用只是对象的另一个名字



int iVal = 1024;
int &refVal = iVal;
refVal++;
cout << iVal  << endl; //1025



const引用



const int iVal = 1024;
const int &refVal = iVal;