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
Why do we use oops?
How do you achieve polymorphism?
What is class and example?
Explain virtual inheritance?
How long to learn object oriented programming?
What is object in oop?
class type to basic type conversion
What is polymorphism in oops?
How oops is better than procedural?
What is the problem with multiple inheritance?
Can static class have constructor?
What is protected in oop?
What does no cap mean?
What is multilevel inheritance explain with example?
What is the difference between static polymorphism and dynamic polymorphism?