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



catch(exception &e) { . . . } Referring to the sample code above, which one of the ..

Answer / guest

cout<<typeid(e).name() is the correct one

Is This Answer Correct ?    5 Yes 0 No

catch(exception &e) { . . . } Referring to the sample code above, which one of the ..

Answer / santhoo035

ans:c

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C++ General Interview Questions

What are c++ storage classes?

0 Answers  


Is the declaration of a class its interface or its implementation?

0 Answers  


What is the use of pointer in c++ with example?

0 Answers  


What is a hash function c++?

0 Answers  


Which one between if-else and switch is more efficient?

0 Answers  






Explain static and dynamic memory allocation with an example each.

0 Answers  


What is the difference between a declaration and a definition?

0 Answers  


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; }

1 Answers   Quark,


Which ide is best for c++?

0 Answers  


Why can you not make a constructor as const?

3 Answers  


What is data hiding c++?

0 Answers  


What is abstract class in c++?

0 Answers  


Categories