Abl-electronic PIC Microcontrollers PIC16 Manuale Utente Pagina 78

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 312
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 77
Pointer Arithmetic
Pointer arithmetic in C is limited to:
- assigning one pointer to another,
- comparing two pointers,
- comparing pointer to zero (
NULL),
- 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
& and sizeof ), it
is implicitly converted to the pointer pointing to array’s first element. Due to this
fact, arrays are not modifiable lvalues.
Brackets
[ ] indicate array subscripts. The expression
id
[
exp
]
is defined as
*((
id
) + (
exp
))
where either:
id
is a pointer and
exp
is an integer, or
id
is an integer and
exp
is a pointer.
The following is true:
&a[i] = a + i
a[i] = *(a + i)
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
70
MikroElektronika:
Development
tools
-
Books
-
Compilers
page
Vedere la pagina 77
1 2 ... 73 74 75 76 77 78 79 80 81 82 83 ... 311 312

Commenti su questo manuale

Nessun commento