I'm attempting to overload the () operator
to accept a long
, that code is below.
struct print{
void operator()(long x){
printf("Number: %d\n",x);
}
};
However when I write this:
print p();
long l = 10;
p(l);
The compiler yells at me saying "error : too many arguments in function call" on the line that corresponds to p(l);
Why isn't this working, did I overload the () operator
correctly?