reference.cpp
来自「数据结构常用算法合集」· C++ 代码 · 共 23 行
CPP
23 行
//reference.cpp
#include <iostream.h> //cout
#include <conio.h> //getch()
void main()
{ int mother; //变量
int &mami=mother; //与mother同地址
int &woman=mami; //与mother同地址
mother = 36;
cout << "mami =" << mami << endl;
cout << "woman=" << woman << endl;
cout << "mother="<< mother << endl;
cout << " mami 加1后:\n";
mami++;
cout << "mami =" << mami << endl;
cout << "woman=" << woman << endl;
cout << "mother="<< mother << endl;
cout << " address as followings:\n";
cout << "mother : " << hex << &mother << endl;
cout << "mami : " << &mami << endl;
cout << "woman : " << &woman << endl;
getch();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?