template<class T, class X> class Obj {
T my_t;
X my_x;
public:
Obj(T t, X x) : my_t(t), my_x(x) { }
};
Referring to the sample code above, which one of the
following is a valid conversion operator for the type T?
a) T operator T () { return my_t; }
b) T operator(T) const { return my_t; }
c) operator(T) { return my_t; }
d) T operator T (const Obj &obj) { return obj.my_t; }
e) operator T () const { return my_t; }



template<class T, class X> class Obj { T my_t; X my_x; public: Obj(T t, X ..

Answer / guest

option 'e' is the correct one

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Perform addition, multiplication, subtraction of 2-D array using Operator Overloading.

0 Answers   Nucleus, TCS,


Can you use the function fprintf() to display the output on the screen?

0 Answers  


In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h

0 Answers  


What is private public protected in c++?

0 Answers  


CAN U SAY WHICH PROGRAMING LANGUAGE IS USED BY DOCTORS....?

1 Answers  






Write a program to calculate the BMI of a person using the formula BMI = weight/height2.

2 Answers  


What are proxy objects in c++?

0 Answers  


What does '\r' and '\b' mean? Please explain with example.

7 Answers  


What is the default access level?

0 Answers  


What is ios in c++?

0 Answers  


How do you write a function that can reverse a linked-list?

0 Answers  


Is c++ built on c?

0 Answers  


Categories