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
Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?
What are the manipulators in c++?
What is the purpose of extern storage specifier?
Is ca high or low level language?
Describe protected access specifiers?
How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?
What is stl containers in c++?
When should you use global variables?
State the difference between pre and post increment/decrement operations.
Which software is used to run c++ program?
What is a class template in c++?
Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..
Explain the advantages of using friend classes.
Can static member variables be private?
What is the use of :: operator in c++?