What is the output of this program?
#include <iostream>
using namespace std;
template <class type>
class Test
{
public:
Test()
{
};
~Test()
{
};
type Funct1(type Var1)
{
return Var1;
}
type Funct2(type Var2)
{
return Var2;
}
};
int main()
{
Test<int> Var1;
Test<double> Var2;
cout << Var1.Funct1(200);
cout << Var2.Funct2(3.123);
return 0;
}
a) 100
b) 200
c) 3.123
d) 200 3.123
Submitted by: Administratord) 200 3.123
Submitted by:
Submitted by:
Read Online C++ Template Job Interview Questions And Answers
Top C++ Template Questions
☺ | What is Template class? |
☺ | What is Cass template? |
☺ | Please tell me how is static data member similar to a global variable? |
☺ | Tell us what is the STL, standard template library? |
☺ | What is Class element in C++? |
Top C Plus Plus Language Categories
☺ | C++ Pointers & Functions Interview Questions. |
☺ | C++ Operator Overloading Interview Questions. |
☺ | C++ Exception Handling Interview Questions. |
☺ | C++ Virtual Functions Interview Questions. |
☺ | C++ Template Interview Questions. |