001、
[root@localhost test]# ls test.c [root@localhost test]# cat test.c #include <stdio.h> int main(void) { int i; printf("i = "); scanf("%d", &i); if(i > 0) { puts("greater than 0"); break; } else { puts("less than 0"); } return 0; } [root@localhost test]# gcc test.c -o kk test.c: In function ‘main’: test.c:12:17: error: break statement not within loop or switch ## break声明仅仅用于loop和switch语句中 12 | break; | ^~~~~
。
标签:12,17,within,break,switch,test,loop From: https://www.cnblogs.com/liujiaxin2018/p/18419728