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
When should we use multiple inheritance?
Can we use pointers in c++?
How do you show the declaration of a virtual constructor?
When should overload new operator on a global basis or a class basis?
What is the use of lambda in c++?
What are all predefined data types in c++?
Can I learn c++ as my first language?
Can a program run without main in c++?
Write about the local class and mention its use?
How do you flush a buffer in c++?
What is the best it certification?
How do we balance an AVL Tree in C++?
What are the uses of c++ in the real world?
Is c++ vector dynamic?
What is the c++ programming language used for?