User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
249
Note
Do not confuse comma operator (sequence operator) with comma punctuator which separates elements in a function
argument list and initializator lists. To avoid ambiguity with commas in function argument and initializer lists, use
parentheses. For example,
func(i, (j = 1, j + 4), k);
calls the function func with three arguments (i, 5, k), not four.
Statements
Statements specify a ow of control as the program executes. In the absence of specic jump and selection statements,
statements are executed sequentially in the order of appearance in the source code.
Statements can be roughly divided into:
- Labeled Statements
- Expression Statements
- Selection Statements
- Iteration Statements (Loops)
- Jump Statements
- Compound Statements (Blocks)
Labeled Statements
Each statement in a program can be labeled. A label is an identier added before the statement like this:
label_identier: statement;
There is no special declaration of a label – it just “tags” the statement. Label_identier has a function scope and
the same label cannot be redened within the same function.
Labels have their own namespace: label identier can match any other identier in the program.
A statement can be labeled for two reasons:
1. The label identier serves as a target for the unconditional goto statement,
2. The label identier serves as a target for the switch statement. For this purpose, only case and default
labeled statements are used:
case constant-expression : statement
default : statement