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

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?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting For Financial Instruments Questions!