Which of the following overloadings will be invoked by this call?

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) Neither, the compiler cannot decide which of these to use.

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...

I have a pointer, nodePtr to a node that is a struct in a linked list. I want to access the member named data. I do this using the expression

a. nodePtr.data b. nodePtr->data c. *nodePtr.data d. (*nodePtr).data e. data is private, you can’t access data under any circumstances.

Computer Science & Information Technology

What is the purpose of the paging procedure in Bluetooth?

What will be an ideal response?

Computer Science & Information Technology

To export ________ from one database to another, you must copy and paste the records

A) tables B) objects C) table relationships D) selected records

Computer Science & Information Technology

Design SQL queries that return each of the following expressions, assuming that R and S are tables representing the relations R and S, respectively: (i) R [ S, (ii) R \ S (iii) R ???? S, (iv) R / S.

For (i) to (iii), you may also assume that R and S are union compatible. For (iv), you may assume that S has attributes b1, ..., bm, and R has in addition attributes a1, ..., an.

Computer Science & Information Technology