CodesJava

Easy learning with example program codes

CPP Exception Handling


Exception handling is necessary in an efficient code, as if it is not handled properly, further execution of code stops as soon as any exception occurs. CPP provides numerous ways and features to handle these exceptions in CPP codes, which makes the code more vulnerable to exceptional situations.

Exception can refer to any situation and condition that does not go with the normal flow of the program and thus have a tendency to halt the execution of the program in between. Some of the common exception classes defined in CPP are listed below.

EXCEPTION CLASS USES
std::exception Exception and parent class of all standard CPP exceptions.
std::logic_failure Exception that can be detected by reading a code.
std::runtime_error Exception that cannot be detected by reading a code.
std::bad_exception Unexpected exceptions in a CPP program.
std::bad_cast Exception thrown by dynamic_cast.
std::bad_typeid Exception thrown by typeid.
std::bad_alloc Exception thrown by new.

 

 

 

Posted in CPP   
Sign Up/ Sign In
Ask a Question


Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at hr@codesjava.com.

Development

We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on hr@codesjava.com.

Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki