Added what I call virtual io to tinycc this way we can make a monolitic executable...
[tinycc.git] / tests2 / 03_struct.c
blobdf0d3e76a62a08be7d8e4a51aaf6fb795d2ef12a
1 #include <stdio.h>
3 struct fred
5 int boris;
6 int natasha;
7 };
9 void main()
11 struct fred bloggs;
13 bloggs.boris = 12;
14 bloggs.natasha = 34;
16 printf("%d\n", bloggs.boris);
17 printf("%d\n", bloggs.natasha);
19 struct fred jones[2];
20 jones[0].boris = 12;
21 jones[0].natasha = 34;
22 jones[1].boris = 56;
23 jones[1].natasha = 78;
25 printf("%d\n", jones[0].boris);
26 printf("%d\n", jones[0].natasha);
27 printf("%d\n", jones[1].boris);
28 printf("%d\n", jones[1].natasha);
30 return 0;