why does calling an overloaded function with arguments that don't match still work
问题 I am not able to explain why the second call ( B ) doesn't give any errors as there are two char elements, and there is no certain match for this call. Why it is called the second one ( 2. ) , but not the first ( 1. ) version? I've noticed that there are some automatic conversions. The thing that i don't get is why 'a' is promoted to int and 'c' isn't. // 1. int fun(int a, int b) { return a + b; } // 2. int fun(int a, char b) { return b - a; } // 3 int fun(float a, float b) { return a * b; }