Exercises
41. | Extend Program 4-2 so that every call to ReportException contains sufficient information so that the exception handler can report precisely what error occurred and also delete the output file if its contents are not meaningful. |
42. | Extend Program 4-3 by generating memory access violations, such as array index out of bounds and arithmetic faults and other types of floating-point exceptions not illustrated in Program 4-3. |
43. | Augment Program 4-3 so as to print the actual value of the floating-point mask after enabling the exceptions. Are all the exceptions actually enabled? Explain the results. |
44. | What values do you actually get after a floating-point exception, such as division by zero? Can you set the result in the filter function as Program 4-3 attempts to do? |
45. | What happens in Program 4-3 if you do not clear the floating-point exception? Explain the results. Hint: Request an additional exception after the floating-point exception. |
46. | Extend Program 4-5 so that the handler routine raises an exception rather than returning. Explain the results. |
47. | Extend Program 4-5 so that it can handle shutdown and log-off signals. |
48. | Confirm through experiment that Program 4-5's handler routine executes concurrently with the main program. |
49. | Enhance Program 4-3 and 4-4. Specifically, handle floating-point and arithmetic exceptions before invoking SEH. |
