| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
E.what in 'catch' clauses
I often see in 'catch' clauses phrases that look like this:
Code:
cerr<<e.what()<<endl; What does this do? is e the exception object thrown? what does the 'what()' function do? Thanks |
|
#2
|
||||
|
||||
|
Yes it is usually the exception object being thrown. It probably inherits from std::exception which has the what() member function. This function returns a const char* with the description of the exception.
__________________
There is no such thing as C/C++, you either program C or C++ |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > E.what in 'catch' clauses |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|