Expressions - mikroElektronika PIC Microcontrollers PIC12 User Manual

Mikroc user's manual
Table of Contents

Advertisement

mikroC
making it simple...

EXPRESSIONS

An expression is a sequence of operators, operands, and punctuators that specifies
a computation. Formally, expressions are defined recursively: subexpressions can
be nested without formal limit. However, the compiler will report an out-of-mem-
ory error if it can't compile an expression that is too complex.
In ANSI C, the primary expressions are: constant (also referred to as literal), iden-
tifier, and
Expressions are evaluated according to certain conversion, grouping, associativity,
and precedence rules that depend on the operators used, the presence of parenthe-
ses, and the data types of the operands. The precedence and associativity of the
operators are summarized in Operator Precedence and Associativity. The way
operands and subexpressions are grouped does not necessarily specify the actual
order in which they are evaluated by mikroC.
Expressions can produce an lvalue, an rvalue, or no value. Expressions might
cause side effects whether they produce a value or not.
Comma Expressions
One of the specifics of C is that it allows you to use comma as a sequence opera-
tor to form the so-called comma expressions or sequences. Comma expression is a
comma-delimited list of expressions – it is formally treated as a single expression
so it can be used in places where an expression is expected. The following
sequence:
expression_1 , expression_2 ;
results in the left-to-right evaluation of each expression, with the value and type of
expression_2
sion_1
MikroElektronika: Development tools - Books - Compilers
mikroC - C Compiler for Microchip PIC microcontrollers
, defined recursively.
( expression )
giving the result of the whole expression. Result of
is discarded.
expres-
page
113

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents