Datasheet
PUNCTUATORS
The mikroC PRO for AVR punctuators (also known as separators) are:
[ ] – Brackets
( ) – Parentheses
{ } – Braces
, – Comma
; – Semicolon
: – Colon
* – Asterisk
= – Equal sign
# – Pound sign
Most of these punctuators also function as operators.
Brackets
Brackets [ ] indicate single and multidimensional array subscripts:
char ch, str[] = "mikro";
int mat[3][4]; /* 3 x 4 matrix */
ch = str[3]; /* 4th element */
Parentheses
Parentheses ( ) are used to group expressions, isolate conditional expressions,
and indicate function calls and function parameters:
d = c * (a + b); /* override normal precedence */
if (d == z) ++x; /* essential with conditional statement */
func(); /* function call, no args */
void func2(int n); /* function declaration with parameters */
Parentheses are recommended in macro definitions to avoid potential precedence
problems during an expansion:
#define CUBE(x) ((x) * (x) * (x))
For more information, refer to Operators Precedence And Associativity and Expres-
sions.
138
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroC PRO for AVR
CHAPTER 5