I wrote two functions like that
int absolute(int a) { return (a < 0) ? -a:a;}
int absolute(int &a) { return (a = (a < 0) ? -a:a;}
The two function have the same name and the same type,
When I do like that:
int main() {
int a = -1;
absolute(a);
return a;
}
there is a error when I compile it, BUT it is not because of the two function but the calling absolute(a);
I'm wondering how to call these two functions correctly, thx!