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
What is meant by stl in c++?
If P is the population on the first day of the year, B is the birth rate, and D is the death rate, the estimated population at the end of the year is given by the formula: The population growth rate is given by the formula: B – D Write a program that prompts the user to enter the starting population, birth and death rates, and n, the number of years. The program should then calculate and print the estimated population after n years. Your program must have at least the following functions: 1. growthRate: This function takes its parameters the birth and death rates, and it returns the population growth rate. 2. estimatedPopulation: This function takes its parameters the current population, population growth rate, and n, the number of years. It returns the estimated population after n years Your program should not accept a negative birth rate, negative death rate, or a population less than 2. please answer my question ....
Who wrote stl?
i wanted to know about questions about c,c++ , which is required for placements.... im a fresher
What is a list in c++ stl?
What is a stl vector?
What are stl algorithms?
What two types of containers does the stl provide?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
Explain stl.
What is a standard template library (stl)?
how to use C++?
What are the different types of stl containers?
What are the components of stl?
write a program that will accept a number and print.its equivalent in words the maximum input number is 9999