xzt123

xzt123 t1_iybn96i wrote

What language? In Java you can label the loop and break out of the loop by name.

In C#, your use of goto is probably ok. C# has more rules about goto, it can't be anywhere and I believe it can't skip variable definitions. C# also has a use of goto where switch blocks cannot fall through cases, that have statements, without an explicit goto statement to go to the next labeled case. It makes missing a break; statement accidentally not possible.

Anyway, obviously a ton of languages out there, so curious which one?

1