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

Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?

1015


What are the manipulators in c++?

983


What is the purpose of extern storage specifier?

1097


Is ca high or low level language?

1013


Describe protected access specifiers?

1142


How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?

936


What is stl containers in c++?

989


When should you use global variables?

1147


State the difference between pre and post increment/decrement operations.

1020


Which software is used to run c++ program?

942


What is a class template in c++?

1001


Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..

3789


Explain the advantages of using friend classes.

1089


Can static member variables be private?

1113


What is the use of :: operator in c++?

1057