#include <iostream>
void main()
{
int num1(5);
int num2(10);
int *pnum(&num1);
std::cout <<"pnum的地址:"<< pnum << std::endl;
std::cout <<"num1的地址" <<&num1 << std::endl;
int* &rpnum(pnum);
std::cout <<"pnum的地址"<< &pnum << std::endl;
std::cout <<"rpnum的地址" <<rpnum << std::endl;
rpnum = &num2;
std::cout << *pnum << std::endl;
system("pause");
}
#include <iostream>
void main()
{
int num1(5);
int num2(10);
int *p;
std::cout << &num1 << " " << num2 << std::endl;
p = &num1;//&num1在寄存器
p = &num2;
int * &&rpnum = &num1;//一个引用符代表引用左值,两个引用符号代表引用右值。
int *p = rpnum;//引用右值用于对象复制
system("pause");
}