📄 ch9_6.cpp
字号:
//*********************
//** ch9_6.cpp **
//*********************
#include <iostream.h>
float temp;
float fn1(float r)
{
temp = r*r*3.14;
return temp;
}
float& fn2(float r)
{
temp = r*r*3.14;
return temp;
}
void main()
{
float a=fn1(5.0); //1
float& b=fn1(5.0); //2:warning
float c=fn2(5.0); //3
float& d=fn2(5.0); //4
cout<<a<<endl;
cout<<b<<endl;
cout<<c<<endl;
cout<<d<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -