[Solved] Overloaded C++ function float parameters error [duplicate]


The function call func(1.14, 3.33) is ambiguous because 1.14 and 3.33 are doubles and both can be converted to either int or float. Therefore the compiler does not know which function to call.

You can fix this by explicitly specifying the type of the constants func(float(1.14), float(3.33)) or by changing the overload from func(float, float) to func(double, double).

In this case, explicitly telling the compiler which type to use is probably a better idea.

1

solved Overloaded C++ function float parameters error [duplicate]