Answer Posted / aboelella
Template is used to optimize code
instead of implementing the same code for multiple data
types, template works as a way to declare classes and
functions and then to be implemented with different data types
It is dependent on the data structure used to substitute the
template
Is This Answer Correct ? | 18 Yes | 0 No |
Post New Answer View All Answers
what are the decision making statements in C++? Explain if statement with an example?
What is meaning of in c++?
what is the difference between overloading & overriding? give example.
Which should be more useful: the protected and public virtuals?
Is c++ a pure oop language?
What should main() return in c and c++?
How a macro differs from a template?
I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.
What is a constant reference?
What is the difference between structure and class?
What is the role of static keyword for a class member variable?
What are literals in C++?
In the derived class, which data member of the base class are visible?
What are the types of array in c++?
When should we use container classes instead of arrays?