16
|
1
|
|
2 struct aaa{
|
|
3 int a; // 4
|
|
4 char b; // 1
|
|
5 int c; // 4
|
|
6 double d; // 8
|
|
7 char e[10]; //10
|
|
8 }; //27 --> 32
|
|
9
|
|
10 int main(int argc, char **argv){
|
|
11 struct aaa A;
|
|
12 A.a = 10;
|
|
13 A.b = 'A';
|
|
14 A.c = 20;
|
|
15 A.d = 1.11;
|
|
16 A.e[0] = 'A', A.e[1] = 'Z';
|
|
17
|
|
18 printf("sizeof aaa = %d\n", sizeof(struct aaa));
|
|
19 tset01( A, 10);
|
|
20 return 0;
|
|
21 }
|
|
22
|
|
23 void tset01( struct aaa B, int size){
|
|
24 printf("B.a = %d\n", B.a);
|
|
25 printf("B.b = %d\n", B.b);
|
|
26 printf("B.c = %d\n", B.c);
|
|
27 printf("B.d = %lf\n", B.d);
|
|
28 B.e[9] = '\0';
|
|
29 printf("B.e = %s\n", B.e);
|
|
30 printf("size = %d\n", size);
|
|
31 }
|