📄 passref.cpp
字号:
// passref.cpp
// arguments passed by reference
#include <iostream>
using namespace std;
int main()
{
void centimize(double&); //prototype
double var = 10.0; //var has value of 10 inches
cout << "var = " << var << " inches" << endl;
centimize(var); //change var to centimeters
cout << "var = " << var << " centimeters" << endl;
return 0;
}
//--------------------------------------------------------------
void centimize(double& v)
{
v *= 2.54; //v is the same as var
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -