What is a template?
Answers were Sorted based on User's Feedback
Answer / yughandhar
templates r used to create generic classes and functions.
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / 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 |
Answer / p suresh kumar
The template specifies a set of parameterized classes or
functions.
| Is This Answer Correct ? | 7 Yes | 3 No |
Answer / yughandhar
Templates is one of the features added to c++ recently.a
template can be considered as a kind of macro.
Templates are mainely used for creating the generic classes
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / debika mohapatra
Templates is one of the features added to c++ recently.a
template can be considered as a kind of macro.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / rakesh kumar
Templates is one of the features added to c++ recently.a
template can be considered as a kind of macro.
Templates are mainely used for creating the generic classes
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / yughandhar
template is a kind of macro to create generic classes and
generic functions to do a specific task
| Is This Answer Correct ? | 1 Yes | 1 No |
What is virtual constructors/destructors?
Difference between realloc() and free?
What is abstraction?
i hav very low percentage in 12th n BSCwhich is around 50.......coz it was just imposed on me 2 b a science graduate,nw m doin MCA n hav aggregate 74% ....what shud i answer if company's HR ask me about dis much low previous percentage??????
which is platform independent device used in computers
what is the difference between class and object?
I am developing a payroll system mini project.I used file concept in program for reading and writing.When the program is reloading into the memory that is if i execute next time the file was cleaned and adding data from the starting this is my problem.I want to strore the previous data and if i want to add any record that should be next of previous data.Please help me.
Why polymorphism is used in oops?
Why is encapsulation used?
There are 2 classes defined as below public class A { class B b; } public class B { class A a; } compiler gives error. How to fix it?
What is difference between oop and pop?
what are the ways in which a constructors can be called?