English
Language : 

CC78K0S Datasheet, PDF (116/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 6 CONTROL STRUCTURES OF C LANGUAGE
Labeled Statements
case label
EXAMPLE 2
int i ;
void main (void){
/* ... */
i = 2;
switch(i) {
case 1:
i=i+4;
case 2:
i=i+3;
case 3:
i=i+2;
}
/* ... */
}
EXPLANATION
In example 2, the processing starts in the second case statement since i is 2. The third statement is also
consecutively performed since the case statement does not include a break statement. Thus, if the constant
expression and the control expression in the case statement match, the programs thereafter are performed
sequentially. A break statement is used to exit the switch statement.
116
User’s Manual U14872EJ1V0UM