In what cases using of a 'template' is a better approach
then using of a 'base class'?
Answer Posted / nishikant sahu
You can judge the need of Template and base class based on
following rule of thumb..
When operation(Method) doesn't affect on changing the data
type, use template.for ex when you want to write the stack
class of different data TYPE(int, bool,flaot) PUSH & POP
method doesn't affect on changing the data TYPE so in this
case you have to use TEMPLATE instead of Inheritance.
When operation(Method) does affect on changing the data
type, use Inheritance(base class).
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is a standard template library (stl)? What are the various types of stl containers?
Q1. A. What is unary operator? List out the different operators involved in the unary operator. B. What is an adjust field format flag? Q2. A. Distinguish between a # include and #define. B. Can a list of string be stored within a two dimensional array? Q3. A.Explain how a pointer to function can be declared in C++? B.List the merits and demerits of declaring a nested class in C++? Q4. A. What are the syntactic rules to be avoid ambiguity in multiple inheritence? B. Explain the operation of overloading of an assignment operator. Q5. A. Explain how the virtual base class is different from the conventional base classes of the opps. B. Explain how an exception handler is defined and invoked in a Program. Q6. A. What is a binary file? List the merits and demerits of the binary file usagein C++. B. Write short notes on Text Manipulation Routines. C. Write bites in Turbo c++ Header (“Include”) Files.
what is template and type convertion
What is meant by stl in c++?
how to making game in c++ ?
How connect plc and pc through software
how can u do connectivity in c++ language? plz send me connectivity code in c++ ?
What is stl language?
When did c++ add stl?
write a program that will accept a number and print.its equivalent in words the maximum input number is 9999
In what scenario does the Logical file and Physical file being used?
write a program to convert a decimal number in to its equivalent binary number?
Describe the My Computer and My Documents folders; identify the elements that are present in every Window.
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
Explain stl.