In what cases using of a 'template' is a better approach
then using of a 'base class'?

Answer Posted / ashwini kumar

Template is used when you have to use different data types
in a single Class.In run time compiler alloate memory for
data.Template is also used to reduce the complicity of any
program,But in base class Complexity is high in larger
program,because you have to create different class for
passing different data types.In template you can create
only one.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is stl part of c++ standard?

631


write a program that will accept a number and print.its equivalent in words the maximum input number is 9999

2491


What does stl mean in slang?

640


When did c++ add stl?

719


To modify an, existing worksheet. What steps are involved for: 1. Inserting and deleting rows and columns. 2. Printing cell formulas 3Jld displayed values 3. Using the page setup command

1767






Name the different types of stl containers.

682


a program using one dimensional array that searches a number if it is found on the list of given input numbers given by the user and locate its exact location in the list.

1366


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

2082


Describe how to safeguard a system through acquisition of an antivirus Program and systematic backup.

1636


Is string part of stl?

668


Is stl open source?

623


How is stl different from c++ standard library?

724


What is a list in c++ stl?

684


help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase

1873


i wanted to know about questions about c,c++ , which is required for placements.... im a fresher

1692