Hello everyone,
Any ideas why there is no ambiguity issues in the code? Which myfunc is called?
The code can pass compile and link in Visual Studio 2008 without any warning messages. The output is 100.
Code:int myfunc (int& a) {return 100;} int myfunc (const int& a) {return 200;} int main() { int a = 1; int& ra = a; int rtn; rtn = myfunc (ra); // call which myfunc? output 100 return 0; }
thanks in advance,
George