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 the main difference between sizeof() operator in c and c++

3 Answers  


which is best institute to learn c,c++ in ameerpet hyderabad

1 Answers  


What is nutshell in programming language?

1 Answers   Satyam, Tech Mahindra,


What is namespace?

15 Answers  


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

0 Answers   HCL,






What is the main purpose of inheritance law?

0 Answers  


what is oops

4 Answers   NIIT,


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??????

3 Answers   Infosys,


class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash

0 Answers  


Why we use classes in oop?

0 Answers  


how can we design a magic square in c++?or suggest me the basic idea of it.

3 Answers  


Precompilation ?

1 Answers   emc2,


Categories