Which of the following overloadings will be invoked by this call?
g(1.0,2.0);
a. int g(int count, double value);
b. void g(double value, int count);
c. void g(int value, int count);
d. Neither, the compiler cannot decide which of these to use.
d)
Explanation: The compiler tries to find an exact match, and there is none. Then the compiler tries to find a match using automatic type conversion. Part c) is excluded because use would result in two double to int conversions. The compiler says there is an ambiguity between a) and b).
Computer Science & Information Technology
You might also like to view...
Write an ethereal capture filter expression for Question 10.
What will be an ideal response?
Computer Science & Information Technology
?When a task requires ____ access, the User Account Control feature might prompt you to authorize the task.
A. ?basic B. ?guest C. ?standard D. ?administrator
Computer Science & Information Technology