a label can only be part of a statement and a declaration is not a statement

如下会报错

label:
        int a = 0 ;

label的定位是一个语句,只能在非定义前面放着,解决的方法是使用一个空语句

label:;
        int a = 0;

你可能感兴趣的:(a label can only be part of a statement and a declaration is not a statement)