Technical Discussion :: C++
Home > Technical Interview Q&A > C++ > Discussion
114 / 187
What are the purpose of the exception handling?
Answer:
The purpose of exception handling mechanism is to provide means to detect and report an “exception circumstanceâ€. So that appropriate action can be taken. The mechanism suggests a separate error handling code that performs the following tasks.
1. Find the problem (hit the exception).
2. Inform than an error has occurred (throw the exception).
3. Receives the error information (catch the exception).
4. Take corrective action (handle the exception).
Asked In ::
Pradeepa
23 Feb, 2019 5:07 AM
The purpose of exception handling mechanism is to provide means to detect and report an “exception circumstanceâ€. So that appropriate action can be taken. The mechanism suggests a separate error handling code that performs the following tasks.
1. Find the problem (hit the exception).
2. Inform than an error has occurred (throw the exception).
3. Receives the error information (catch the exception).
4. Take corrective action (handle the exception).
1. Find the problem (hit the exception).
2. Inform than an error has occurred (throw the exception).
3. Receives the error information (catch the exception).
4. Take corrective action (handle the exception).