User manual
mikroC PRO for dsPIC
MikroElektronika
251
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 specic 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 identier added before the statement like this:
label_identier: statement;
There is no special declaration of a label – it just “tags” the statement. Label_identier has a function scope and
the same label cannot be redened within the same function.
Labels have their own namespace: label identier can match any other identier in the program.
A statement can be labeled for two reasons:
1. The label identier serves as a target for the unconditional goto statement,
2. The label identier 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