C++ Questions and Answers - 2

Question: 6

How are functions invoked in function overloading?

Look for the exact match of a function prototype with that of a function call statement.

In case an exact match is not available, it looks for the next nearest match.

That is, the compiler will promote integral data promotions and then match the call statement with function prototype.

Question: 7

What does the term operator overloading refer to?

The term operator overloading, refers to giving additional functionality to the normal C++ operators like +, ++, -, --, +=, -=, *, <, >.

Question: 8

What are the possible integral promotions while invoking overloaded functions?

Char data type can be converted to integer/float/double.

Int data type can be converted to char/double/float.

Float data type to integer/double/char.

Double data type to float or integer.

Related Questions