Answers to Self-Review Exercises

  1. 17.1 Insufficient memory to satisfy a new request, array subscript out of bounds, arithmetic overflow, division by zero, invalid function parameters.

  2. 17.2

    1. Exception handling is designed to handle infrequently occurring situations that often result in program termination, so compiler writers are not required to implement exception handling to perform optimally.

    2. Flow of control with conventional control structures generally is clearer and more efficient than with exceptions.

    3. Problems can occur because the stack is unwound when an exception occurs and resources allocated prior to the exception might not be freed.

    4. The “additional” exceptions make it more difficult for you to handle the larger number of exception ...

Get C++ How to Program, 10/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.