L7_exception_handling

L7_exception_handling - Exceptions Exceptions For : COP...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Exceptions For : COP 3330. Object oriented Programming (Using C++) http://www.compgeom.com/~piyush/teach/3330 Piyush Kumar Material from “4th ed. Programming and Problem solving with C++, Dale, Weems. Exceptions Exceptions are run time anomalies, such as division by zero, that require immediate handling when encountered by your program. The C++ language provides built in support for raising and handling exceptions. With C++ exception handling, your program can communicate unexpected events to a higher execution context that is better able to recover from such abnormal events. Useful when the code that detects the problem cannot handle it (Exception Detection code). Control must be transferred to the code that can handle such error. (Exception Handling code). Exceptions in C++ Communication between exception detection and exception handling parts of the program in C++. It involves: throw expressions try blocks exception classes The try, throw, and catch statements
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

L7_exception_handling - Exceptions Exceptions For : COP...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online