C++ – use break to exit multiple nested ‘for’ loops

breakcfor-loopnested-loops

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?

Best Answer

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