i have a question about the function call in the following example:
int main()
{
int a, b;
cin >> a >> b >> endl;
cout << *f(a,b);
return 0;
}
So is *f(a,b) a valid function call?
Edit:: sorry for the errors, i fixed them now i’m a little tired
The code at least could be reasonable. For it to work,
fmust be defined as a function that returns either of two sorts of things: either it returns a pointer, in which case the*dereferences the pointer, so whatever it was pointing at gets sent to standard output. Otherwise,fmust return some user-defined type that definesoperator *to return something that’s compatible withcout.