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 are the benefits of operator overloading?
State two differences between C and C++.
What is this weird colon-member (" : ") syntax in the constructor?
Explain what you mean by a pointer.
What is the difference between passing by reference and passing a reference?
Write about the retrieval of n number of objects during the process of delete[]p?
How a pointer differs from a reference?
what are the iterator and generic algorithms.
Why is c++ still used?
How do I use turbo c++?
What are the advantages of using a pointer? Define the operators that can be used with a pointer.
What is object in c++ wikipedia?
What is atoi?
Is there a c++ certification?
What is vectorial capacity?