Does anyone know how to break out of embedded for loops with the same command from the inner loop?
example:
I know I could have an extra conditional in the outer loop that checks a variable that gets set by the "if", but that's a lot of extra processing.Code:for(i = 0;i < 10;i ++){ for(n = 0;n < 10;n ++){ if(myFunction(i,n)){ //do something //break out of both loops } } }
Thanks for any help.




Reply With Quote