When is a template better solution than a base class??
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / faruk
1.when you are designing a generic class to contain or otherwise manage objects of other types.
2.when the format and behaviour of those other types are unimportant to their containment or management.
3.particularly when those other types are unknown.
| Is This Answer Correct ? | 3 Yes | 1 No |
Will a catch statement catch a derived exception if it is looking for the base class?
What is virtual constructor paradigm?
What is the use of class in c++?
What is insertion sorting?
How do you link a C++ program to C functions?
What is a friend function in c++?
Explain about profiling?
Is sorted c++?
wap to accept 10 numbers & display the number of odd and even numbers??
Explain the term memory alignment?
Differentiate between a pointer and a reference with respect to c++.
Can I create my own functions in c++?