I've been programming a pair of overloaded C++ functions, one taking 2 integer parameters, and the other 2 floats.
But the codeblocks compiler says:
error: call of overloaded 'func(double, double)' is ambiguous
Why double
if I'm specifying a float
?
I'm using the two functions to sum their values and showing the result on cout
inside them. Float values given as arguments are 1.14 and 3.33, not big floating numbers...
Someone knows? thx!
#include <iostream>
using namespace std;
void func(int a, int b) {
cout << a+b;
}
void func(float a, float b)
cout << a+b;
}
int main() {
func(3, 7);
func(1.14, 3.33);
}