When the code flow is like this:
if(check())
{
...
...
if(check())
{
...
...
if(check())
{
...
...
}
}
}
I have generally seen this work around to avoid the above messy code flow:
do {
if(!check()) break;
...
...
if(!check()) break;
...
...
if(!check()) break;
...
...
} while(0);
What are some better ways that avoid this work-around/hack so that it becomes a higher-level (industry level) code?
Any suggestions which are out of the box are welcome!