This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

(switch) ERROR: non-constant case/dim expresion

Hi. I used the following code, and appeared the error "error C110: non-constant case/dim expresion" at the "case" line, what does it mean? ...

void main(void){
  char command[]={1,2,3,4,5,6,7,8};
  char word;
//........
  while(1){
/*
......... some lines of code
*/
     switch(word){
       case command[0]:  // do somthing
                  break;
//...................
       case command[7]:  // do somthing
                  break;

     }
  }
}

Thank you.

0