Restrict a function to throw certain exceptions - Exception Handling - Defining function with throw clause

Q.  How can we restrict a function to throw certain exceptions?
- Published on 19 Jul 15

a. Defining multiple try and catch block inside a function
b. Defining generic function within try block
c. Defining function with throw clause
d. It is not possible in CPP to restrict a function

ANSWER: Defining function with throw clause

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)