What is a template?

Answers were Sorted based on User's Feedback



What is a template?..

Answer / yughandhar

templates r used to create generic classes and functions.

Is This Answer Correct ?    7 Yes 0 No

What is a template?..

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

What is a template?..

Answer / p suresh kumar

The template specifies a set of parameterized classes or
functions.

Is This Answer Correct ?    7 Yes 3 No

What is a template?..

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

What is a template?..

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

What is a template?..

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

What is a template?..

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

Post New Answer

More OOPS Interview Questions

What is sub classing in c++?

1 Answers  


We have a scale and 7 balls. 1 ball is heavier than all the rest. How to determine the heaviest ball with only 3 possible weighing attempts?

8 Answers   IBM, Sage, Vertex,


pointers are support in C#? if yes then how to use it?

8 Answers   Softvision Solution,


What is the benefit of oop?

0 Answers  


what is the basic concept of inheritance?

9 Answers  






write a c++ code to overload + and - for a stack class such that + provides push and - provides pop operation

1 Answers   College School Exams Tests, HCL, IBM, TCS,


write a C++ program for booking using constructor and destructor.

0 Answers   HAL,


What is encapsulation oop?

0 Answers  


What type of Job you are providing?

0 Answers  


What is ambiguity in c++

4 Answers   Accenture, Mphasis,


What is difference between new and malloc?

7 Answers   emc2,


What is encapsulation in oop?

0 Answers  


Categories