How to implement exception handling in C++?

Submitted by: Administrator
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 they 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.
Submitted by: Administrator

Read Online C++ Exception Handling Job Interview Questions And Answers