When is a template a better solution than a base class, C/C++ Programming

When you are designing a generic class to have or otherwise manage objects of other types, when the format and behavior of those other types are unimportant to their containment or management, and particularly when those other types are unknown (therefore, the genericity) to the designer of the container or manager class.            

 

 

Posted Date: 4/9/2013 12:58:35 AM | Location : United States







Related Discussions:- When is a template a better solution than a base class, Assignment Help, Ask Question on When is a template a better solution than a base class, Get Answer, Expert's Help, When is a template a better solution than a base class Discussions

Write discussion on When is a template a better solution than a base class
Your posts are moderated
Related Questions
Write a Program to illustrate Array? int x[100]; char text[80]; float temp[30]; static int marks[5]; We are able to use symbolic constants instead of expression. The valu

create a shopping cart in c++

Ask queCreate an object oriented application with C# that computes the area of a rectangle, and the area and the volume of a cuboid. Based on the inheritance concept, create a bas

write aprogram in c++ to overload +,-,=,++ operator using unary and friend function in a single program

Aim: To implement a program to handle stack overflow, underflow and odd number exception using Exception Handling. Code: #include #include #include #define MAX

C Program for REMOVING CHAR WHICH U WANT void main() {           int i,j;           char a[100],r;           clrscr();           for(i=0;i

The program reads two numbers and a character (operator). If the character is "+" then sum is displayed. If it is "-"then difference is displayed. If it is "*" then product is disp

Question 1 Write a program that accepts two numbers from the user and swaps the two numbers without using a temporary variable Question 2 Write a program that accepts a 3x

C Program for MAXIMUM NO, MINIMUM NO AND SORTING   void main() {           int i,j,t;           int a[5];           clrscr();           for(i=0;i

How to specify different memory sections for a variable using #Pragma?