C++ MQCs with Explanation ( EXCEPTION HANDLING)

We may restrict the types of exception thrown from a function

  1. by placing the try block in the function itself
  2. by placing the try block in the main that invokes the function
  3. by adding a throw (type-list) to the function definition
  4. by adding an empty throw ( ) in the function header line



Answer: 
Option c: by adding a throw (type-list) to the function definition

Explanation Here

Post a Comment

0 Comments