6. (Exception Handling, Small Research Project) This chapter seems to be a suitable place to discuss how

Question:

6. (Exception Handling, Small Research Project)

This chapter seems to be a suitable place to discuss how C++ supports exception handling, error codes and error conditions (see Josuttis, 2012 for an introduction). All exceptions generated by the standard library inherit from std::exception. We reduce the scope by focusing on the following kinds of exceptions:

logic_error invalid_argument domain_error length_error out_of_range future_error(C++11)

runtime_error range_error overflow_error underflow_error bad_weak_ptr(C++11)

bad_function_call(C++11)

Answer the following questions:

a) Determine the kinds of run-time errors that can be handled by these exception classes.

Think of simple examples to generate and catch these kinds of exceptions.

b) Determine how to discover and catch underflow, overflow and NaN errors.

c) Can any of these exception classes be used with the code in Section 8.5?

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: