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 |
without if else statement can be written ah
1.Between 100 and 999 are some numbers that have the characteristics that if you cube the individual digits and sum together you will get the same number. 2. A program that can accept as input an integer and output the equivalent of that number in words.
Can we change the basic meaning of an operator in c++?
What are the advantages of c++ over c?
What are the benefits of c++?
i want the NIC programmer-B model papaer pattren, iwant the all model papers?
Explain Memory Allocation in C/C++ ?
What are the advantages of early binding?
What do you mean by translation unit?
What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero
What is void pointer in c++ with example?
What is set in c++?