小编For*_*Bat的帖子

如何打破内部for循环并返回parent for循环

我这里有代码,

for(int i=0;i<5;i++)
{
    for(int j=0;j<5;j++)
    {
        //checking some conditions here for true or false
        if(false)
        {
            break out of this for loop;
        }
        else if(true)
        {
            printf("true");
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我想打破内部for循环并继续外循环.我尝试使用,break但控件也移出了父for循环.

对此有何解决方案?

c c++

2
推荐指数
1
解决办法
6867
查看次数

标签 统计

c ×1

c++ ×1