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