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
What is the difference between #import and #include?
Is atoi safe?
How can I learn dev c++ programming?
Write is a binary search tree? Write an algo and tell complexity?
Write my own zero-argument manipulator that should work same as hex?
what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?
When do we run a shell in the unix system?
How is objective c different from c++?
What is flush c++?
When should I use unitbuf flag?
What is prototype for that c string function?
Explain the operation of overloading of an assignment operator.
What flag means?
How many namespaces are there in c++?
Write a function to find the nth item from the end of a linked list in a single pass.