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 |
how much classes are used in c++
what is the usage of clas templates
Finding of the 4 larger (bigger) numbers from the list like{1245,4587,2145,1163,29987,65783.....}
What is the difference between const int *ptr and int const *ptr???
How can i write a code in c# to take a number from the user and then find all the prime numbers till the number entered by the user.
What is operator overloading? Give Example
11 Answers CTS, IBM, TCS,
1. Wrie a function which returns the most frequent number in a list of integers. Handle the case of more than one number which meets this criterion. public static int[] GetFrequency(int[] list)
What causes polymorphism?
what is virtual destructor
If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?
What is encapsulation selenium?
What is memory leak and memory corruption?