annotate test/multi.c @ 639:f3af9f3332f5

*** empty log message ***
author kono
date Tue, 31 Oct 2006 22:40:37 +0900
parents
children 04211a2cf227
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
639
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
1
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
2 int printf(const char *,...);
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
3
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
4 #define LEN0 10
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
5 #define LEN1 10
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
6
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
7 typedef int ARRAY[LEN0][LEN1];
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
8
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
9 int a[LEN0][LEN1];
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
10
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
11 int
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
12 f(ARRAY a)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
13 {
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
14 int i,j;
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
15
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
16 j = a[1][1];
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
17 for(i=0;i<LEN0;i++)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
18 for(j=0;j<LEN1;j++)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
19 printf("f %d %d = %d\n",i,j,a[i][j]);
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
20
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
21 }
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
22
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
23 int
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
24 main()
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
25 {
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
26 int i,j;
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
27 j = a[1][1];
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
28
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
29 for(i=0;i<LEN0;i++)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
30 for(j=0;j<LEN1;j++)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
31 a[i][j] = i*100 + j;
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
32
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
33 for(i=0;i<LEN0;i++)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
34 for(j=0;j<LEN1;j++)
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
35 printf("m %d %d = %d\n",i,j,a[i][j]);
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
36
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
37 f(a);
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
38 }
f3af9f3332f5 *** empty log message ***
kono
parents:
diff changeset
39