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).
You might also like to view...
In order to perform file processing in C++, which header files must be included?
a.
A new class of objects can be created conveniently by inheritance—the new class (called the ________) starts with the characteristics of an existing class (called the ________), possibly customizing them and adding unique characteris-tics of its own.
Fill in the blank(s) with the appropriate word(s).
What does the T represent in the following statement?
``` template < class T > ``` a. the name of the function template b. T stands for Template c. a generic data type that is used in a function template d. the int data type e. None of these
An asymmetric encryption key that does have to be protected.
What will be an ideal response?