int f(){} // may or may not throw an exception
int main()
{
int x;
try
{
x=f();
}
catch(int &ex)
{
if(ex==666)
goto skip;
// if ex!=666 continue execution below catch{} block
}
// code
skip:
// more code
}
If f() throws 666, I want to skip a block of code under catch(...). Is this possible without using goto?
int f(){} // may or may not throw an exception
int main()
{
int x;
try
{
x = f();
// code
}
catch(int &ex)
{
if (ex != 666)
{
// do your exception handling ...
}
}
// more code
}
int f(){} // may or may not throw an exception
int main()
{
int x;
try
{
x = f();
try
{
// code
}
catch(...)
{
}
}
catch(int &ex)
{
if (ex != 666)
{
// exception handling ...
}
}
// more code
}