467
|
1 #include <stdio.h>
|
448
|
2
|
|
3 int b[3] = {1,2,3};
|
|
4
|
|
5 struct temp {
|
|
6 int a;
|
|
7 int b;
|
|
8 int c;
|
|
9 int d;
|
542
|
10 struct hoge {
|
|
11 int k;
|
|
12 int j;
|
|
13 } m;
|
448
|
14 int e;
|
|
15 } temp1 = {
|
|
16 // 101,
|
|
17 // 102,
|
|
18 // 103,
|
|
19 // 104,
|
|
20 // 105,
|
|
21 .e = 5,
|
|
22 .a = 3
|
|
23 };
|
|
24
|
|
25 struct temp temp3 = {
|
|
26 .c = (int)&b,
|
|
27 .d = -10,
|
|
28 .a = (int)b
|
|
29 };
|
|
30
|
542
|
31 struct temp temp4 = { 1,2,3,4,5,6,7};
|
|
32 struct temp temp7 = { 1,2,3,4,{5,6},7};
|
448
|
33
|
|
34
|
542
|
35 int
|
448
|
36 main()
|
|
37 {
|
|
38 struct temp temp2 = { .c = 5, .e=99 };
|
542
|
39 #ifdef WRONG
|
|
40 struct temp temp5 = { 1,2,3,4,5,6,7,8};
|
|
41 struct temp temp6 = { 1,2,3,4,5,6};
|
|
42 #else
|
|
43 struct temp temp5 = { 1,2,3,4,5,6,7};
|
|
44 struct temp temp6 = { 1,2,3,4,5,6,7};
|
|
45 struct temp temp8 = { 1,2,3,4,{5,6},7};
|
|
46 #endif
|
|
47 printf("#0042:1: %d\n",temp1.a);
|
|
48 printf("#0043:1: %d\n",temp1.e);
|
|
49 printf("#0044:1: %d\n",temp1.b);
|
|
50 printf("#0045:2: %d\n",temp2.c);
|
|
51 printf("#0046:2: %d\n",temp2.e);
|
|
52 printf("#0047:2: %d\n",temp2.b);
|
|
53 printf("#0048:2: %d\n",(void*)temp3.c==b);
|
|
54 printf("#0049:2: %d\n",temp3.c==(int)b);
|
|
55 printf("#0050:2: %d\n",temp3.a==(int)&b);
|
|
56 printf("#0051:2: %d\n",temp4.m.j);
|
|
57 printf("#0051:2: %d\n",temp5.m.j);
|
448
|
58 return 0;
|
|
59 }
|