WAP to show rethrowing concept in oop by using suitable
#include <iostream>
using namespace std;
void function()
{
try
{
throw "Good day";
}
catch (const char *)
{
cout << "\nException inside function\n";
throw;
}
}
int main()
{
try
{
function();
}
catch (const char *)
{
cout << "\nException inside main function";
}
return 0;
}
Comments
Leave a comment