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 |
Define a pdb file.
How const int *ourpointer differs from int const *ourpointer?
What is the full form of c++?
Does dev c++ support c++ 11?
What do you mean by translation unit in c++?
What are the syntactic rules to be avoid ambiguity in multiple inheritance?
Is c++ vector a linked list?
Write syntax to define friend functions in C++.
What is c++ in english?
What is polymorphism in c++? Explain with an example?
What is the difference between the functions memmove() and memcpy()?
List down the guideline that should be followed while using friend function.