catch(exception &e)
{
. . .
}
Referring to the sample code above, which one of the
following lines of code produces a written description of
the type of exception that "e" refers to?
a) cout << e.type();
b) cout << e.name();
c) cout << typeid(e).name();
d) cout << e.what();
e) cout << e;
Answers were Sorted based on User's Feedback
What are c++ storage classes?
Is the declaration of a class its interface or its implementation?
What is the use of pointer in c++ with example?
What is a hash function c++?
Which one between if-else and switch is more efficient?
Explain static and dynamic memory allocation with an example each.
What is the difference between a declaration and a definition?
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; }
Which ide is best for c++?
Why can you not make a constructor as const?
What is data hiding c++?
What is abstract class in c++?