Answer Posted / achal
In C++ there are 2 kinds of templates. i) function
templates ii) Class templates.
Among these class templates are more common.
e.g.
template <class T > class Sample
{
public:
T m1;
void fun(T);
};
Now here we have created a class which has a data member of
type T. Now this T can be int, unsigned int, char etc.
Thus templates are said to be used for generic programming.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What do you mean by const correctness?
Is map ordered c++?
What is the full form nasa?
Why do we need runtime polymorphism in c++?
What is constructor and destructor in c++?
Explain how to initialize a const data member.
Eplain extern keyword?
What is the difference between while and do while loop? Explain with examples.
How does java differ from c and c++?
what are the iterator and generic algorithms.
What are iterators in c++?
Why the usage of pointers in C++ is not recommended ?
Explain the extern storage classes in c++.
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create
Explain static and dynamic memory allocation with an example each.