第一章课后题4_2(P59)

#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=" << ref<<"," << "p的地址:" << p << ",p的值:" << *p << endl;
system("pause");
return 1;
}

posted @ 2020-02-26 18:00  CollisionDimension  阅读(114)  评论(0)    收藏  举报