Next: Ein sehr umfassendes Beispiel
Up: Datentypen, Operatoren, Arrays, Structs
Previous: Structs
#include <iostream.h>
main()
{
// Definition
struct ZweiWerte{
int x;
int y;
};
struct ZweiWerte a; // Deklaration
struct ZweiWerte *b; // Pointer auf Struct
b = &a;
a.x = 1;
a.y = 2;
cout <<a.x <<a.y << endl;
cout <<b->x <<b->y << endl;
}
| © 1997 Gottfried Rudorfer, C++-AG, Lehrveranstaltungen, Abteilung für Angewandte Informatik, Wirtschaftsuniversität Wien, 3/19/1998 |