-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
49 lines (40 loc) · 757 Bytes
/
main.c
File metadata and controls
49 lines (40 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <stdio.h>
#include "linklist.h"
int
main (void)
{
assem as;
unsigned int i, j;
linklist *tmp, *tmpx, *tmpy;
initx (&as, 0);
for (i = 0; i < 15; i++)
{
addx (&as, tmpx = newll ());
as.beginy = as.endy = tmpx;
for (j = 0; j < 10 - 1; j++)
{
addy (&as, newll ());
}
}
tmpx = as.beginx;
while (tmpx)
{
tmpy = tmpx;
printf ("============= value of x = %d ===============\n", tmpx->idx);
while (tmpy)
{
printf ("x = %d\ty = %d\n", tmpx->idx, tmpy->idy);
tmpy = tmpy->forwy;
}
tmpx = tmpx->forwx;
}
tmpx = as.beginx;
while (tmpx)
{
tmp = tmpx;
tmpx = tmpx->forwx;
as.beginx = as.beginy = tmp;
freey (&as);
}
return (0);
}