RE-THROWING AN EXCEPTION
<iostream>
using namespace std;
divide(double x, double y)
{
cout << "Inside function \n";
try
{
(y==0.0)
y;
cout << "Division=" << x/y << "\n";
}
(double)
{
cout << "caught double inside function \n";
;
}
cout << "End of function \n \n";
}
main()
{
cout << "Inside main \n";
try
{
divide(10.5,2.0);
divide(20.0,0.0);
}
(double)
{
cout << "Caught double inside main \n";
}
cout << "End of main \n";
0;
}
|