When is a template better solution than a base class??

Answer Posted / mayank kumar

as template is in form of generic class and generic
function so here the class and function works for all. also
in template we can change the data type of function
parameter as well as of the data member present in class.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define token in c++.

886


What are the c++ access specifiers?

1049


What is meant by const_cast?

848


What is an operator function? Describe the function of an operator function?

840


Explain the uses of static class data?

832


What is ios flag in c++?

865


Is c++ a programming language?

788


write a programme to get a character and thier ASCII value

2787


What is called array?

801


Can a function take variable length arguments, if yes, how?

754


Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?

973


What are virtual constructors/destructors?

750


Can I learn c++ as my first language?

838


What is the best c++ compiler for windows 10?

762


What is a manipulator in c++?

917