If I use a break statement, it will only break inner loop and I need to use some flag to break the outer loop. But if there are many nested loops, the code will
break
for(int i = 0; i < 1000; i++) { for(int j = 0; j < 1000; i++) { if(condition) { func(para1, para2...); return; } } } func(para1, para2...) { stmt2; }