自考新教材-p59_4(2)

源程序:

#include <iostream>
using namespace std;
int main()
{
int oneInt = 1;
int &ref = oneInt;
ref = 2;
cout << "oneInt=" << oneInt << "," << "ref=" << ref << endl;
int *p = &ref;
*p = 3;
cout << "ref=" << "," << "p的地址:" << p << ",p的值:" << *p << endl;
system("pause");
return 1;
}

运行结果:

原文地址:https://www.cnblogs.com/duanqibo/p/12268545.html