When I try the below program its gives me the :error C2064: I tried in google but not able to find the exact reason. Please help.
class myClass
{
public:
void function(myClass dTemp)
{
cout<<"Inside myClass: taking myClass parameter"<<endl;
}
};
.
int main()
{
myClass myClassTemp;
myClass myClassTemp1;
myClassTemp(myClassTemp1);// error C2064: term does not evaluate to a function taking 1 argument.
return 0;
};
Did you mean to be able to call an object of type
myClasslike a function? You need to overloadoperator()for that:If you instead wanted to call the function, well, you should actually do so: