1.

What are Templates in C++?(a) A feature that allows the programmer to write generic programs(b) A feature that allows the programmer to write specific codes for a problem(c) A feature that allows the programmer to make program modular(d) A feature that does not add any power to the languageI got this question in exam.This intriguing question originated from Function Templates topic in division Derived Classes, Templates & Exception Handling in C++ of C++

Answer»

Correct ANSWER is (a) A feature that allows the programmer to WRITE generic programs

Best EXPLANATION: Templates are features in C++ that allows the programmer to write generic programs. for example, MAKING the same function to take different types of arguments and perform the same ACTION on them without specifying the type in the argument list.



Discussion

No Comment Found

Related InterviewSolutions