- 博客(1)
- 收藏
- 关注
原创 C语言中进入无限循环的三种方法
我们在使用C语言时,希望程序执行到某一处时就停止继续向下运行,因此可以让程序进入一个无限循环语句中。下面分享三种方法。1、使用while语句这种是最常用的。 while(1) { ; }2、使用for语句 int a; for (a = 0; a <2; a++) { a = 0; }3、使用goto语句int a;fail:a = 1; if (a != 2) { goto fail; }...
2022-03-29 23:20:32 14053
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人