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 references in c++? What is a local reference?
What is the role of static keyword for a class member variable?
What is the difference between function overloading and operator overloading?
Why is c++ still popular?
Why is c++ a mid-level programming language?
What is c strings syntax?
What is a stack? How it can be implemented?
How are the features of c++ different from c?
What is a constructor and how is it called?
What is the use of c++ programming language in real life?
What are the advantages of pointers?
How the endl and setw manipulator works?
How can I learn c++ easily?
How does a copy constructor differs from an overloaded assignment operator?
Does c++ vector allocate memory?