Redirected
recategorized
1,708 views
0 votes
0 votes

Which one of the following is correct for overloaded functions in $C++$?

  1. Compiler sets up a separate function for every definition of function.
  2. Compiler does not set up a separate function for every definition of function.
  3. Overloaded functions cannot handle different types of objects.
  4. Overloaded functions cannot have same number of arguments.
recategorized

3 Answers

Best answer
1 votes
1 votes
When you call an overloaded function or operator, the compiler determines the most appropriate definition to use by comparing the argument types you used to call the function or operator with the parameter types specified in the definitions. The process of selecting the most appropriate overloaded function or operator is called overload resolution.

Ans: (A)
0 votes
0 votes

The compiler sets up a separate function for every definition of function this is due to overload function in C++. For more information in overloading function. Refer:Function Overloading in C++ So, option (A) is correct.

Answer:

Related questions

0 votes
0 votes
3 answers
1
go_editor asked Mar 24, 2020
2,354 views
Which of the following cannot be passed to a function in C++?ConstantStructureArrayHeader file
0 votes
0 votes
3 answers
2
go_editor asked Mar 24, 2020
2,011 views
Which of the following operators cannot be overloaded in $\textsf{C/C++}$ ?Bitwise right shift assignmentAddress ofIndirectionStructure reference