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
How did c++ get its name?
What is the full form of c++?
Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?
What are manipulators in c++ with example?
What are function prototypes?
Should you pass exceptions by value or by reference?
What is the real purpose of class – to export data?
Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..
What is the difference between global int and static int declaration?
What does n mean in c++?
How do I exit turbo c++?
How long will it take to learn programming?
List the features of oops in c++?
What is difference between c++ 11 and c++ 14?
How much is c++ certification?