Welcome to C++ 15
FAQ
1.9 Which function will be called if the following function call is made?
max(6.6,1999.90,11.5)
max(int,int,int);
Ans. The compiler resolves the call to overloaded function as follows:
(i) Exact Match: The compiler searches the function of the exact parameters with no con-
versions or only trivial conversions. Examples of trivial conversions are array name to
pointer, function name to pointer to a function. An example of conversion of array name
to pointer is as follows.
int p[ ]={10,5,1234};
fun(p); // Calls function fun(int*);
if it exists
(ii) Function signature match using integral promotions: For example, char to int, short to
int, fl oat to double, and such.
char ch='A';
fun(ch); // Calls function fun(int); ...