关于 函数调用运算符 的类问题
#include<iostream.h>class Fun
{
public:
double operator ( ) (double x,double y) const
{
return (x*x+5*x-8)*(y+5);
}
};
void main()
{
Fun f1,f2;
cout<<f1(1.5,2.0)<<end1;
cout<<f2(2.1,1.0)<<end1;
}
请各位大侠看一下为什么运行不出来?????
#include<iostream> using namespace std; class Fun { public: double operator ( ) (double x,double y) const { return (x*x+5*x-8)*(y+5); } }; void main() { Fun f1,f2; cout<<f1(1.5,2.0)<<endl; cout<<f2(2.1,1.0)<<endl; }