quote:Original post by DamoclesThe last two breaks are redundant; the code path never gets there. In short, it doesn''t work.for (loop1)for (loop2)for (loop3) if (someCondition) { break; break; break; }
Use goto.
quote:Original post by DamoclesThe last two breaks are redundant; the code path never gets there. In short, it doesn''t work.for (loop1)for (loop2)for (loop3) if (someCondition) { break; break; break; }
quote:Original post by lonesock
The original post asked about breaking out of nested loops: there is no indication that the function ends there, so I think the "return" based responses may not be what Muppi is asking for (nesting your nested loops in another function?
quote:Original post by fractoid
What language?
If Java or C++, you can use exceptions. Or, if you don''t mind people looking at you funny, you can use goto.