自动推断返还类函数
#include<iostream>using namespace std;
const double Pi =3.14159265;
auto Area(double radius) 编译器一直提示这里出错,是什么原因啊?怎么消除这个错误啊?感谢各位大神了!
{
return Pi * radius * radius;
}
int main()
{
cout<<"Enter radius:";
double radius=0;
cin>>radius;
//Call function"Area"
cout<<"Area is:"<<Area(radius)<<endl;
return 0;