#include <iostream>
using namespace std;
int main()
{
int a = 3;
// 引用相当于别名,对引用的操作相当于对本身进行操作
int &b = a;
b = 10;
cout << a << endl;// 10
cout << b << endl; // 10
system("pause");
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int a = 3;
// 引用相当于别名,对引用的操作相当于对本身进行操作
int &b = a;
b = 10;
cout << a << endl;// 10
cout << b << endl; // 10
system("pause");
return 0;
}
C++入门知识,包括命名空间,引用,函数重载等。
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M