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

Given the following function definition: int doit(int &x, int y, int &z) { x = 3*x; y = y + 5; z = x+y; return z - 4; } int a = 5, b = 7, c = 9, d = 11; d = doit(a,b,c);

2 Answers  


What is "strstream" ?

1 Answers   Huawei,


Explain friend class?

0 Answers  


Explain static and dynamic memory allocation with an example each.

0 Answers  


What is the full form of stl in c++?

0 Answers  






What is a parameterized type?

1 Answers  


const char * char * const What is the differnce between the above two?

11 Answers   TCS,


What's the order in which the objects in an array are destructed?

0 Answers  


Where and why do I have to put the "template" and "typename" keywords?

0 Answers  


Can we generate a C++ source code from the binary file?

2 Answers  


Is recursion allowed in inline functions?

0 Answers  


How can you specify a class in C++?

0 Answers  


Categories