-
Notifications
You must be signed in to change notification settings - Fork 0
/
AOS.c
58 lines (33 loc) · 770 Bytes
/
AOS.c
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
49
50
51
52
53
54
55
56
57
#include <stdio.h>
struct test {
char a;
char b;
char c;
};
int AOS() {
struct test my_struct;
printf("\n\nstruct size: %d\n",sizeof(my_struct));
struct test arr[4];
arr[0].a = 'h';
arr[0].b = 'u';
arr[0].c = 'l';
arr[1].a = 'l';
arr[1].b = 'o';
arr[1].c = ' ';
arr[2].a = 'w';
arr[2].b = 'o';
arr[2].c = 'r';
arr[3].a = 'l';
arr[3].b = 'd';
arr[3].c = '!';
int arr_size = sizeof(arr);
printf("array size: %d\n\n",arr_size);
int base_location = (int) arr;
for (int i=0;i<arr_size;i++){
int location = base_location+i;
char character = *(char*) location;
printf("%c",character);
}
printf("\n\n");
return 0;
}