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?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How the virtual functions maintain the call up?

1143


Difference between overloading vs. Overriding

1068


How is new() different from malloc()?

1102


What are structures and unions?

988


Why was c++ made?

1076


What is a binary file? List the merits and demerits of the binary file usagein C++.

1283


What is the benefit of encapsulation?

1060


What are the two shift operators and what are their functions?

1077


What is #include cmath?

1080


What is a v-table?

1155


Why iomanip is used in c++?

1117


how to access grid view row?

2220


Which programming language is best to learn first?

1045


What is object file? How can you access object file?

1186


What is double in c++?

1045