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
How does class accomplish data hiding in c++?
How did c++ start?
What are maps in c++?
What do you mean by overhead in c++?
What is fflush c++?
Which coding certification is best?
What is algorithm in c++ programming?
A mXn matrix is given and rows and column are sorted as shown below.Write a function that search a desired entered no in the matrix .with minimum complexity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Is swift a good first language?
How would you use the functions memcpy(), memset(), memmove()?
Tell me an example where stacks are useful?
Differentiate between C and C++.
What happens when the extern "c" char func (char*,waste) executes?
what is the difference between overloading & overriding? give example.
Describe public access specifiers?