Answer Posted / ravinandan
Template is used for generic programming. In other words
when you want to write a function or a class type
independent, go for templates.
template<class T>
void fun(T x, T y); // Is a Template function
template<typename T>
class abc{
T m;
}; // Is a Class Template
template<class T>
class abc{
T m;
}; // Is a Class Template
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What polymorphism means?
What is abstract class in oop?
Why is destructor used?
What is difference between oop and pop?
What is methods in oop?
Why multiple inheritance is not allowed?
What is class and example?
What is encapsulation c#?
What is ambiguity in inheritance?
explain sub-type and sub class? atleast u have differ it into 4 points?
What is overriding in oops?
What is difference between class and object with example?
What is the problem with multiple inheritance?
What is the difference between static polymorphism and dynamic polymorphism?
is there any choice in opting subjects like 4 out of 7