#include <stdio.h>
int main(int argc,char **argv)
{
int i = 0;
goto err2;
err10:
if(i%2)
{
err11:
printf("i is single:%d \n",i);
}
err00:
else
{
err01:
printf("i not is single:%d \n",i);
}
err2:
for(;i++ < 10;)
{
if(i%2)
goto err11;
else
goto err01;
}
return 0;
}
//goto.c 编译 报错
goto.c: In function ‘main’:
goto.c:15: error: ‘else’ without a previous ‘if’
goto.c:14: warning: label ‘err00’ defined but not used
goto.c:8: warning: label ‘err10’ defined but not used