我想知道当验证结束条件(不同于正确的迭代次数)时是否可以在C++中结束for循环.例如:
for (int i = 0; i < maxi; ++i)
for (int j = 0; j < maxj; ++j)
// But if i == 4 < maxi AND j == 3 < maxj,
// then jump out of the two nested loops.
Run Code Online (Sandbox Code Playgroud)
我知道这可能在Perl中使用下一个LABEL或最后一个LABEL调用和标记的块,是否可以在C++中执行它或者我应该使用while循环?
谢谢.