English
Language : 

CC78K4 Datasheet, PDF (123/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 6 CONTROL STRUCTURES OF C LANGUAGE
(3) break statement
Branch Statements
break
FUNCTION
A break statement may appear in the body of a loop and in the body of a switch statement and causes control to
be transferred to the statement next to the loop or switch statement.
SYNTAX
break ;
EXAMPLE
Int i;
unsigned char count, flag;
void main(void) {
/* ... */
for (i = 0;i < 20;i++) {
switch(count){
case 10 :
flag = 1;
break;
default:
func() ;
}
if (flag)
break ;
}
}
/* exit switch statement */
/*exit for loop */
EXPLANATION
In the above example, break statements are used so that more than required evaluations are not performed in
the body of the switch statement. If the corresponding case label is found in evaluating the switch statement,
the break statement causes C to exit from the switch statement.
NOTE
A break statement can only be used as the body of a looping or switch statement or in the loop or switch body.
User’s Manual U15556EJ1V0UM
123