English
Language : 

CC78K0S Datasheet, PDF (118/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 6 CONTROL STRUCTURES OF C LANGUAGE
6.2 Compound Statements (Blocks)
A compound statements consist of two or more statements grouped together with enclosing braces and executed
as one unit syntax-wise. In other words, by enclosing zero or more declarations followed by zero or more statements
all in braces, these statements can be processed as a compound statement whenever a single statement is
expected.
6.3 Expression Statements and Null Statements
An expression statement consists of a statement and a semicolon. A null statement consists of only a semicolon
and is used for labels that require a statement and in looping that does not need any body.
The description examples of expression statements and null statements are given below.
As in the following example, for a function to be called as an expression statement merely to obtain side effects,
the value of its return value can be discarded by using a cast expression.
int p(int) ;
void main(void){
/* ... */
(void)p(0) ;
}
A null statement can be used as the body of a looping statement as shown below.
char *s ;
void main(void){
/*...*/
while (*s++ != '0') ;
/*...*/
}
In addition, it can be used to place a label before a brace ( } ) which closes a compound statement as shown
below.
void func(void){
/*...*/
while(loop1){
/*...*/
while(loop2){
/*...*/
if(want_out)
goto end_loop1;
/*...*/
}
end_loop1:;
}
}
118
User’s Manual U14872EJ1V0UM