-4
for (int i = 0; i < 6; i++) {
led_r1 = ~led_r1;
led_r2 = ~led_r2;
led_l1 = 0;
led_l2 = 0;
DelayMs(60);
if (check == 1) {
check = 0;
right_check = 0;
left_check = 0;
goto new_pattern;
}
if (off == 2) {
off = 1;
right_check = 0;
left_check = 0;
goto reset;
}
}
这是我的代码来闪烁两个LED在我的项目... 它工作正常,但我的程序是正确的......? 这种使用goto语句的方式是正确的..? 它会崩溃程序enter code here
上午..? enter code here
c语言中断循环
是他们的任何其他方式终止程序并跳转到程序的其他部分
您是否知道C处已经有一个'破'命令?你为什么不使用它? –
Goto声明被认为是有害的。这是在1968年的突发新闻。 – Lundin
在我的程序中看到如果(关== 2)如果它发生我必须另一个位置..?我怎样才能做到没有goto语句..我是新来的c语言。请给我建议解决方案 – steve