引用和变量的关系

 1 #include <iostream>
 2 #include <iomanip>
 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
 4 using namespace std;
 5 int main(int argc, char** argv) {
 6     int a=10;
 7     int &b=a;
 8     a=a*a;
 9     cout <<a<<setw(6)<<b<<endl;
10     b=b/5;
11     cout <<b<<setw(6)<<a<<endl;
12     return 0;
13 }

猜你喜欢

转载自www.cnblogs.com/borter/p/9401693.html