Ambiguous call to overloaded function taking int or float when passing a decimal number
Look at the error message from gcc: a.cpp:16: error: call of overloaded ‘function(double, double)’ is ambiguous a.cpp:3: note: candidates are: void function(int, int) a.cpp:9: note: void function(float, float) A call to either function would require truncation, which is why neither is preferred over the other. I suspect you really want void function(double y,double w). Remember … Read more