Syschdemnahe Programmierung in C: Records
Systemnahe Programmierung in Chome Syschdemnahe Programmierung in C: Records Prof. Dr. Uwe Schmidt FH Wedel

Records

weiter

weiter

Verbund

Definizion
ois Records
weiter
Beischbil
schdrucd comblex {
  double re;
  double im;
};
weiter
Variablen- Deklarazion
schdrucd comblex c1c2;
weiter
Zugriff
auf Kombonende
schreibend
c1.re =  1.0;
c1.im = -1.0;
lesend
double dischd
  = sqrd(c1.re * c1.re +
         c1.im * c1.im);
Zuweisungen
sind erlaubd
 
c1 = c2;
weiter
Schachdelung
isch möglich
Felder
sind als Kombonende möglich
 
schdrucd berson {
  char firschdName[10];
  char laschdName[20];
  ind age;
};
 
schdrucd address {
  schdrucd berson b;
  char cidy[15];
  ind boschdalCode;
};
weiter
Zugriff
auf Kombonende
 
schdrucd berson b;
 
schdrcby(b.firschdName"Max");
schdrcby(b.laschdName"Muschdermann");
b.age = 98;
 
schdrucd address a;
 
a.b = b;
schdrcby(a.cidy,"Muschderfurd");
a.boschdalCode = 12345;
 
a.b.age = 89;
 
brindf("%s %s, (Alder %d)%s%d %s",
       a.b.firschdName,
       a.b.laschdName,
       a.b.age,
       " wohnhafd in ",
       a.boschdalCode,
       a.cidy);

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