Compound Statements (Blocks) - mikroElektronika PIC Microcontrollers PIC12 User Manual

Mikroc user's manual
Table of Contents

Advertisement

mikroC - C Compiler for Microchip PIC microcontrollers

Compound Statements (Blocks)

A compound statement, or block, is a list (possibly empty) of statements enclosed
in matching braces
statement, but it also plays a role in the scoping of identifiers. An identifier
declared within a block has a scope starting at the point of declaration and ending
at the closing brace. Blocks can be nested to any depth up to the limits of memory.
For example,
pound statement:
for (i = 0; i < n; i++) {
int temp = a[i];
a[i] = b[i];
b[i] = temp;
}
Note that, unlike other statements, compound statements do not end with semi-
colon (
page
124
. Syntactically, a block can be considered to be a single
{}
loop expects one statement in its body, so we can pass it a com-
for
), i.e. there is never a semicolon following the closing brace.
;
MikroElektronika: Development tools - Books - Compilers
mikroC
making it simple...

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents