For each function, f(), g() and h() state how what exceptions should be thrown.

Given these three functions with different exception specifications
a) void f()throw();
b) void g()throw(int, string);
c) void h();

The function f() should throw no exceptions at all unless the exception is caught inside of f(). The function g() should throw only int and string type exceptions. The function h() may throw an exception of any type.

Part a) has an empty exception list, prohibiting any exceptions. Part b) specifies only int and string. Part c) prohibits nothing.

Computer Science & Information Technology

You might also like to view...

Match the following input mask characters to their description:

I. 0 II. 9 III. ? IV. A A. Optional digit or space B. Required digit or letter C. Required digit (0 through 9) D. Optional Letter

Computer Science & Information Technology

A file containing a macro must be saved as a Word Macro-Enabled Document

Indicate whether the statement is true or false

Computer Science & Information Technology