Question 41Asked in UGC NET Computer Science, June 2017 (Paper II & III, Selected Questions)

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

  1. ACompiler sets up a separate function for every definition of function
  2. BCompiler does not set up a separate function for every definition of function
  3. COverloaded functions cannot handle different types of objects
  4. DOverloaded functions cannot have same number of arguments
Show answerHide answer

Correct answer: (A) Compiler sets up a separate function for every definition of function

Explanation

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

From UGC NET Computer Science PYQ, June 2017 (Paper II & III, Selected Questions)

This is question 41 of UGC NET Computer Science PYQ, June 2017 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.