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 are the realtime excercises in C++?
when to use 'mutable' keyword and when to use 'const cast' in c++
Can abstract class have normal methods?
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)
What is protected in oop?
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
is there any choice in opting subjects like 4 out of 7
What is encapsulation c#?
What is the real life example of polymorphism?
What is static modifier?
What is the point of oop?
explain sub-type and sub class? atleast u have differ it into 4 points?
What is difference between pop and oop?
Can we override main method?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?