mikroC - C Compiler for Microchip PIC microcontrollers
Pointer Arithmetic
Pointer arithmetic in C is limited to:
- assigning one pointer to another,
- comparing two pointers,
- comparing pointer to zero (
- adding/subtracting pointer and an integer value,
- subtracting two pointers.
The internal arithmetic performed on pointers depends on the memory model in
force and the presence of any overriding pointer modifiers. When performing
arithmetic with pointers, it is assumed that the pointer points to an array of
objects.
Arrays and Pointers
Arrays and pointers are not completely independent types in C. When name of the
array comes up in expression evaluation (except with operators
is implicitly converted to the pointer pointing to array's first element. Due to this
fact, arrays are not modifiable lvalues.
Brackets
id [ exp ]
is defined as
*(( id ) + ( exp ))
where either:
is a pointer and
id
is an integer and
id
The following is true:
&a[i]
a[i]
page
70
NULL
indicate array subscripts. The expression
[ ]
is an integer, or
exp
is a pointer.
exp
=
a + i
=
*(a + i)
MikroElektronika: Development tools - Books - Compilers
),
mikroC
making it simple...
and
), it
&
sizeof
Need help?
Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?