What do you mean by a template?



What do you mean by a template?..

Answer / Monitosh Sharma

A template is a construct in C++ that allows the creation of generic functions or classes, which can be instantiated multiple times with different types. Templates enable code reuse and improve efficiency by avoiding the need for separate function or class definitions for each type.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Explain how an exception handler is defined and invoked in a Program.

1 Answers  


How should a contructor handle a failure?

1 Answers  


What is the basic concept of c++?

1 Answers  


What is the benefit of c++?

1 Answers  


What is the difference between method and message?

5 Answers   HP,


Describe about storage allocation and scope of global, extern, static, local and register variables?

1 Answers  


You're given an array containing both positive and negative integers and required to find the sub-array with the largest sum (O(N) a la KBL). Write a routine in C for the above.

4 Answers  


What is the most useful programming language?

1 Answers  


Differentiate between an inspector and a mutator ?

1 Answers  


Can java be faster than c++?

1 Answers  


How the keyword struct is different from the keyword class in c++?

1 Answers  


What is the error in the code below and how should it be corrected?

1 Answers  


Categories