WAP to show multiple throw statement execution by using suitable example.
SOLUTION TO THE ABOVE QUESTION
SOLUTION CODE
//In this question we will use multiple throws by re_throwing an exception
#include <iostream>
using namespace std;
int main()
{
try {
try {
throw 40 ;
}
catch (int number) {
cout << "Handling an exception ";
// let us Re-throw the exception
throw;
}
}
catch (int number) {
cout << "Handle remaining part of the exception";
}
return 0;
}
Comments
Leave a comment