Explain how we implement exception handling in C++.- Exception handling in C++ is implemented by using the try{} and catch(){} statements. - When a try block throws an exception, the program leaves the try block and enters the catch statement of the catch block. - If the type of the object thrown matches the arg type in the catch block, catch block is executed for handling the code. - If they are not caught, abort() function is executed by default. - When no exception is deteted or thrown then the control goes to the statement below the catch block.
|