Systemnahe Programmierung in C: Rekursive Strukturen |
1struct wronglist
2{
3 int info;
4 struct wronglist next;
5};
|
1struct node
2{
3 int info;
4 struct node *next;
5};
|
1struct s1
2{
3 int info;
4 struct s2 *next;
5};
6
7struct s2
8{
9 int info;
10 struct s1 *next;
11};
12
13/* besser */
14
15typedef struct node1 *List1;
16typedef struct node2 *List2;
17
18struct node1
19{
20 int info1;
21 List2 next1;
22};
23
24struct node2
25{
26 int info2;
27 List1 next2;
28};
29
30/* Vorwaertsreferenzen mit struct ... * moeglich */
|
1typedef unsigned long Element;
2
3typedef struct node *List;
4
5struct node
6{
7 Element info;
8 List next;
9};
|
Letzte Änderung: 11.01.2007 | © Prof. Dr. Uwe Schmidt |