Abl-electronic PIC Microcontrollers PIC16 Bedienungsanleitung Seite 66

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 312
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 65
Here is an example of two objects with local scope, but with different duration:
void f() {
/* local duration var; init a upon every call to f */
int a = 1;
/* static duration var; init b only upon 1st call to f */
static int b = 1;
/* checkpoint! */
a++;
b++;
}
void main() {
/* At checkpoint, we will have: */
f();
// a=1, b=1, after first call,
f();
// a=1, b=2, after second call,
f();
// a=1, b=3, after third call,
// etc.
}
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
58
MikroElektronika:
Development
tools
-
Books
-
Compilers
page
Seitenansicht 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 ... 311 312

Kommentare zu diesen Handbüchern

Keine Kommentare