When an exception is encontered, the program will intrerupt its notmal workflow and jump to a different place. There is a new "control flow" statement created for handling exceptions. Let's study the workflow:
try-catch workflow
try {
// protected code
} catch( ExceptionName e1 ) {
// catch block
} catch( ExceptionName e2 ) {
// catch block
} catch( ExceptionName eN ) {
// catch block
} catch(...) {
// catch any other exception
}
Wait a second. C++ do not have "finally" block in "try-catch" statement? This is ridiculous. But why?@cppchat @include_cpp #cpp
— Elucian Moise (@elucian_moise) November 19, 2020
Go back to: C++ Tutorial