1 #include <iostream> 2 using namespace std; 3 4 int main() 5 { 6 int rats=101; 7 int &rodents=rats; //&为引用 8 cout<<"rats="<<rats; 9 cout<<",rodents"<<endl; 10 rodents++; 11 cout<<"rats="<<rats; 12 cout<<",rodents"<<rodents<<endl; 13 cout<<"rats address="<<&rats; 14 cout<<",rodents address="<<&rodents<<endl; 15 getchar(); 16 return 0; 17 }