There are 3 overloaded functions.
I would like to know why second is being called here, (on my compiler the second is being called).
Thanks in advance.Code:#include<iostream> using namespace std; int func(short &a) { return a + 1; } int func(int &a) { return a + 2; } int func(long &a) { return a + 3; } int main() { int num = 0; std::cout << func(num) << std::endl; }
Regards
Shaq





Reply With Quote