示例
#include<iostream>
using namespace std;
int main()
{
int temp = 100;
int *point = &temp;
int &t = temp;
getch();
}
反汇编的结果
int temp = 10;
012718E8 mov dword ptr [temp],0Ah
int *point = &temp;
012718EF lea eax,[temp] ;将temp变量的地址赋给eax
012718F2 mov dword ptr [point],eax ;将eax的值赋给point指针
int &t = temp;
012718F5 lea eax,[temp] ;将temp变量的地址赋给eax
012718F8 mov dword ptr [t],eax ;将eax的值赋给t引用
通过反汇编结果可以知道.引用的底层实现就是指针常量.