annotate test/strinit.c @ 492:cc1a5f764782

*** empty log message ***
author kono
date Wed, 21 Dec 2005 12:10:43 +0900
parents a379da780856
children 492f06738550
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
467
32737bad7489 fix list/tag interference
kono
parents: 448
diff changeset
1 #include <stdio.h>
448
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
2
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
3 int b[3] = {1,2,3};
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
4
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
5 struct temp {
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
6 int a;
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
7 int b;
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
8 int c;
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
9 int d;
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
10 int e;
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
11 } temp1 = {
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
12 // 101,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
13 // 102,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
14 // 103,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
15 // 104,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
16 // 105,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
17 .e = 5,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
18 .a = 3
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
19 };
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
20
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
21 struct temp temp3 = {
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
22 .c = (int)&b,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
23 .d = -10,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
24 .a = (int)b
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
25 };
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
26
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
27
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
28
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
29 main()
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
30 {
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
31 struct temp temp2 = { .c = 5, .e=99 };
491
a379da780856 cond signed/unsigned
kono
parents: 467
diff changeset
32 printf("#0031:1: %d\n",temp1.a);
a379da780856 cond signed/unsigned
kono
parents: 467
diff changeset
33 printf("#0032:1: %d\n",temp1.e);
a379da780856 cond signed/unsigned
kono
parents: 467
diff changeset
34 printf("#0033:1: %d\n",temp1.b);
a379da780856 cond signed/unsigned
kono
parents: 467
diff changeset
35 printf("#0034:2: %d\n",temp2.c);
a379da780856 cond signed/unsigned
kono
parents: 467
diff changeset
36 printf("#0035:2: %d\n",temp2.e);
a379da780856 cond signed/unsigned
kono
parents: 467
diff changeset
37 printf("#0036:2: %d\n",temp2.b);
a379da780856 cond signed/unsigned
kono
parents: 467
diff changeset
38 printf("#0037:2: %d\n",(void*)temp3.c==b);
a379da780856 cond signed/unsigned
kono
parents: 467
diff changeset
39 printf("#0038:2: %d\n",temp3.c==(int)b);
a379da780856 cond signed/unsigned
kono
parents: 467
diff changeset
40 printf("#0039:2: %d\n",temp3.a==(int)&b);
448
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
41 return 0;
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
42 }