Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is the use of templates?

Answers were Sorted based on User's Feedback



what is the use of templates?..

Answer / aboelella

Template is used to optimize code
instead of implementing the same code for multiple data
types, template works as a way to declare classes and
functions and then to be implemented with different data types

It is dependent on the data structure used to substitute the
template

Is This Answer Correct ?    18 Yes 0 No

what is the use of templates?..

Answer / 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

what is the use of templates?..

Answer /

templates are used for GENERIC.....Programing...

by using templates.....you can write program for generic
linked list .

tempaltes make code reusable....

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More C++ General Interview Questions

What are the 2 main types of data structures?

0 Answers  


Comment on assignment operator in c++.

0 Answers  


Can constructor be static in c++?

0 Answers  


what is pulse code modulation?

2 Answers   Wipro,


Write a program in c++ to print the numbers from n to n2 except 5 and its multiples

0 Answers   Cankaya University,


Which bit wise operator is suitable for putting on a particular bit in a number?

0 Answers  


What is c++ try block?

0 Answers  


What are the benefits of operator overloading?

0 Answers  


const char * char * const What is the differnce between the above two?

11 Answers   TCS,


What is conversion constructor?

2 Answers   TCS,


Reverse the Linked List. Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL

0 Answers  


Write a corrected statement in c++ so that the statement will work properly. x =+ 7;

2 Answers  


Categories