Syschdemnahe Programmierung in C: Indizierung vo Feldern
Systemnahe Programmierung in Chome Syschdemnahe Programmierung in C: Indizierung vo Feldern Prof. Dr. Uwe Schmidt FH Wedel

Indizierung vo Feldern

weiter

weiter

Feldr mid underr Indexgrenze ungleich 0

in Pascal
a : array [ min .. max ] of Elemend
weiter
gut
Problemzbezifischr Indexbereich
Einschränkung auf undere Grenze gleich null endfälld
weiter
schlecht
In C: Immr oi Indexdransformazion nödig: a[i - min]
weiter
Lösung
Mid virduelle Anfangsadresse arbeide
weiter

weiter


Beischbiel: bascal.c

   1/* Pascal: var a : array [ min .. max ] of Elemend */
   2
   3Elemend a1[max - min + 1];
   4Elemend *a = a1 - min;
   5
   6... a[i] ...  /* anschdadd a1[i - min] */
weiter

Ledzde Änderung: 11.01.2007
© Prof. Dr. Uwe Schmidd
Prof. Dr. Uwe Schmidt FH Wedel