Breymann. C++ Einführung und professionelle Programmierung

Breymann. C++ Einführung und professionelle Programmierung Breymann. C++ Einführung und professionelle Programmierung

vred.bioinf.uni.sb.de
von vred.bioinf.uni.sb.de Mehr von diesem Publisher
17.11.2014 Aufrufe

pa ✲ 35 45 Abb. 6.6: Erzeugen eines int-Arrays mit new[] // Operator new [ ] int *pa = new int[4]; // Array von int-Zahlen pa[1] = 35; pa[2] = 45; cout

Dynamisch erzeugte Struktur Erzeugung und Löschen wie bei den Grunddatentypen struct test_struct { int a; double b; test_struct* next; }; test_struct *sp= new test_struct; Zugriff über Pfeil-Operator ->: sp->a = 12; // entspricht (*sp).a sp->b = 17.4; Breymann C++, c○ Hanser Verlag München Inhalt ◭◭ ◭ ◮ ◮◮ 231 zurück Ende

pa<br />

✲<br />

35<br />

45<br />

Abb. 6.6: Erzeugen eines int-Arrays mit new[]<br />

// Operator new [ ]<br />

int *pa = new int[4]; // Array von int-Zahlen<br />

pa[1] = 35;<br />

pa[2] = 45;<br />

cout

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!