changeset 6 | c3dc3eb3b541 |
child 77 | 49e0babccb23 |
5:d752cbe8208e | 6:c3dc3eb3b541 |
---|---|
1 #include <stdio.h> |
|
2 #include <stdlib.h> |
|
3 #include <list.h> |
|
4 |
|
5 int main (int argc, char **argv) |
|
6 { |
|
7 Node *node, *begin; |
|
8 int i; |
|
9 |
|
10 node = begin = addnode (NULL, "BEGIN"); |
|
11 |
|
12 for (i = 0; i < 1000; i++) |
|
13 node = addnode (node, "I need to strdup it!"); |
|
14 |
|
15 node = begin; |
|
16 |
|
17 while (node) { |
|
18 printf ("%s\n", node->data); |
|
19 node = getnode (node); |
|
20 } |
|
21 |
|
22 return 0; |
|
23 } |