break与continue
continue只能用于循环语句
goto
最常见的用法是终止程序在某些深度嵌套的结构中的处理过程,例如一次跳出两层或多层循环。break只能从最内层循环退出到上一级的循环。

//简单测试

 1 #include <stdio.h>
 2 main(){
 3     int i = 10;
 4     if(i > 0){
 5         //break;        //error
 6         //continue;        //error
 7         goto test;        
 8     }else{
 9         ;
10     }
11     printf("hello\n");
12     test:    {
13         printf("world\n");    //仅输出world 
14     }            
15     return 0;
16 }
View Code

相关文章:

  • 2021-08-03
  • 2022-01-07
  • 2021-06-13
  • 2021-09-25
  • 2021-06-04
  • 2021-12-03
  • 2022-03-03
  • 2021-06-25
猜你喜欢
  • 2021-06-24
  • 2022-01-22
  • 2021-08-19
  • 2022-01-22
  • 2021-06-08
  • 2021-10-18
  • 2022-01-31
相关资源
相似解决方案