zoukankan      html  css  js  c++  java
  • error: a label can only be part of a statement and a declaration is not a statement

    GCC:

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

    switch(a){        swtch(a){

    case 1:         case 1:

    ....................       {

    ....................        ...............

    ....................        ...............

    break;          ................

    case 2:         }

    break;          break;

    }            case 2:

                 break;

                }

    Error         OK

     

     

    case1:
    //此块代码不能再声明变量,如果你声明变量就会报错,除非用括号括起来,这是编译器的问题,也可以说是C语言的规定。写代码的时候注意就成了。就像C语言再声明的时候不能赋值一样,记住就好了。
    break;
    希望对你有所帮助。
  • 相关阅读:
    canvas之碎碎念
    canvas之动态时钟
    属性小问题
    readonly and disabled
    table
    地图热区
    子块元素在父块元素中居中
    Ajax与JS
    前端测试
    html5/css3
  • 原文地址:https://www.cnblogs.com/caidi/p/6273839.html
Copyright © 2011-2022 走看看