goto.c

来自「常用子程序-61个-4.2M.zip」· C语言 代码 · 共 21 行

C
21
字号
#include<reg51.h>
#include<intrins.h>
void Ledon();
void Ledoff();
void Delayx10ms(Byte count);
void GotoDemo(void)
{	bit Fgerror;	Byte i;
	Ledon();
	Delayx10ms(50);
	if(Fgerror) goto error;//只能在函数内部跳转,不能跳到"good"标号
	Ledoff();
	Delayx10ms(50);
error:
	i++;
}
void function (void)
{
good:
 _nop_();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?