For example
for ( int i = 0; i < m; i++ )
{
bool exit = false;
for ( int j = 0; !exit && j < n; j++ )
{
if ( ( exit = some condition ) )
{
// Do something and break...
}
}
if ( exit ) break;
}
Or
bool exit = false;
for ( int i = 0; !exit && i < m; i++ )
{
for ( int j = 0; !exit && j < n; j++ )
{
if ( ( exit = some condition ) )
{
// Do something and break...
}
}
}