Chapter 23 - Exception Handling презентация
Содержание
- 2. 23.1 Introduction Errors can be dealt with at place error occurs Easy
- 3. 23.1 Introduction (II) Exception handling - catch errors before they occur Deals
- 4. 23.1 Introduction (III) Exception handling improves fault-tolerance Easier to write error-processing code
- 5. 23.2 When Exception Handling Should Be Used Error handling should be used
- 6. 23.3 Other Error-Handling Techniques Use assert If assertion false, the program
- 7. 23.3 Other Error-Handling Techniques (II) Test for the error condition Issue an
- 8. 23.4 Basics of C++ Exception Handling: try, throw, catch A function can
- 9. 23.4 Basics of C++ Exception Handling: try, throw, catch (II) Format Enclose
- 10. 23.5 A Simple Exception-Handling Example: Divide by Zero Look at the format
- 11. 1. Class definition 1.1 Function definition
- 12. 1.2 Initialize variables 2. Input data 2.1 try and
- 13. Program Output
- 14. 23.6 Throwing an Exception throw - indicates an exception has occurred Usually
- 15. 23.6 Throwing an Exception (II) Exception not required to terminate program However,
- 16. 23.7 Catching an Exception Exception handlers are in catch blocks Format: catch(
- 17. 23.7 Catching an Exception (II) Catch all exceptions catch(...) - catches
- 18. 23.7 Catching an Exception (III) catch parameter matches thrown object when They
- 19. 23.7 Catching an Exception (IV) Unreleased resources Resources may have been allocated
- 20. 23.8 Rethrowing an Exception Rethrowing exceptions Used when an exception handler cannot
- 21. 1. Load header 1.1 Function prototype
- 22. 2. Function call 3. Output
- 23. 23.9 Exception Specifications Exception specification (throw list) Lists exceptions that can
- 24. 23.10 Processing Unexpected Exceptions Function unexpected Calls the function specified with
- 25. 23.11 Stack Unwinding Function-call stack unwound when exception thrown and
- 26. 23.12 Constructors, Destructors and Exception Handling What to do with an
- 27. 23.12 Constructors, Destructors and Exception Handling (II) Thrown exceptions in constructors
- 28. 23.12 Constructors, Destructors and Exception Handling (II) Resource leak Exception
- 29. 23.13 Exceptions and Inheritance Exception classes can be derived from base
- 30. 23.14 Processing new Failures If new could not allocate memory
- 31. 23.14 Processing new Failures (II) new Loop that tries
- 32. 1. Load headers 1.1 Function definition 1.2 Initialize large
- 33. Program Output
- 34. 1. Load headers 1.1 Function definition 1.2 Initialize large
- 35. Program Output
- 36. 23.15 Class auto_ptr and Dynamic Memory Allocation Pointers to dynamic memory
- 37. 1. Load header 1.1 Class definition 1.2 Function definitions
- 38. 1.3 Initialize auto_ptr pointer 2. Manipulate values 3. Output
- 39. 23.16 Standard Library Exception Hierarchy Exceptions fall into categories Hierarchy of
- 40. 23.16 Standard Library Exception Hierarchy (II) Class runtime_error Errors detected
- 41. Скачать презентацию
Слайды и текст этой презентации