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 global variables and local variable
What is tellg () in c++?
What is iostream in c++ used for?
How can a called function determine the number of arguments that have been passed to it?
What are the unique features of C++.
Write is a binary search tree? Write an algo and tell complexity?
Is c++ a high level language?
How does the copy constructor differ from the assignment operator (=)?
What is DlgProc?
Why do we use using namespace std in c++?
Where can I run c++ program?
What is c++ code?
What is the use of turbo c++?
What is a literal in c++?
What is an iterator?