how to break out of 2 loops in cpp when condition is satisfied code example
Example: how to break out two for loops c++
for (int i = 0; i < n1; ++i) {
[&] {
for (int j = 0; j < n2; ++j) {
for (int k = 0; k < n3; ++k) {
return; // yay we're breaking out of 2 loops here
}
}
}();
}