Can I use break to exit multiple nested 'for' loops?

Faken picture Faken · Aug 11, 2009 · Viewed 246.7k times · Source

Is it possible to use the break function to exit several nested for loops?

If so, how would you go about doing this? Can you also control how many loops the break exits?

Answer

Henk Holterman picture Henk Holterman · Aug 11, 2009

No, don't spoil it with a break. This is the last remaining stronghold for the use of goto.