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

Consider a c++ template funtion
template<class T>
T& Add(T a, T b){return a+b ;}

if this function is called as
T c = Add("SAM", "SUNG");

what will happen? What is the problem in the template
declaration/ How to solve the problem.

Answer Posted / prasad

i will provide error.

declare template function as,
T Add(T a, T b){return a+b ;}

Is This Answer Correct ?    10 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are references in c++? What is a local reference?

990


What is the role of static keyword for a class member variable?

1038


What is the difference between function overloading and operator overloading?

1048


Why is c++ still popular?

995


Why is c++ a mid-level programming language?

976


What is c strings syntax?

1085


What is a stack? How it can be implemented?

1133


How are the features of c++ different from c?

1025


What is a constructor and how is it called?

998


What is the use of c++ programming language in real life?

993


What are the advantages of pointers?

1023


How the endl and setw manipulator works?

978


How can I learn c++ easily?

1023


How does a copy constructor differs from an overloaded assignment operator?

981


Does c++ vector allocate memory?

951