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 |
Does c++ cost money?
How can you quickly find the number of elements stored in a a) static array b) dynamic array ?
What is the extension of c++?
Explain the extern storage classes in c++.
Explain binary search.
What are built-in functions? What is the syntax for the definition?
What are enumerations?
What is c++ flowchart?
What do you mean by Stack unwinding?
Can we get the value of ios format flags?
What is the difference between public and private data members?
what is C++ objects?