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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Incase of a function declaration, what is extern means?

521


What are friend classes? What are advantages of using friend classes?

612


What is a container class?

623


What is an adaptor class in c++?

608


What is bubble sort c++?

577






Explain what are single and multiple inheritances in c++?

561


What is constructor in C++?

632


Is c++ slower than c?

577


In a function declaration what does extern means?

603


Can comments be longer than one line?

626


Write syntax to define friend functions in C++.

603


What is private inheritance?

599


What is object oriented programming (oop)?

625


In c++, what is the difference between method overloading and method overriding?

603


What is static in c++?

596