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

Which of the following is incorrect in C++?

  1. AWhen we write overloaded function we must code the function for each usage
  2. BWhen we write function template we code the function only once
  3. CIt is difficult to debug macros
  4. DTemplates are more efficient than macros
Show answerHide answer

Correct answer: (D) Templates are more efficient than macros

Explanation

The first three statements are correct; the fourth is incorrect. Templates are more powerful and obey C++ syntactic rules, whereas macros do not, but templates take more compilation time and code size, so templates are not more efficient than macros.

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

This is question 40 of UGC NET Computer Science PYQ, June 2015 (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.