blob: e7acde53df12f14818247fd60cfb562984e5402a [file] [log] [blame]
Jack Palevich5fd66ae2009-09-04 15:24:23 -07001void testStruct() {
2 struct str {
3 float x;
4 float y;
5 };
6
7 struct str base;
8 int index = 0;
9
10 base.x = 10.0;
11 struct str *s = &base;
12
13 float *v = &(*s).x;
14 float *v2 = &s[index].x;
15 printf("testStruct: %g %g %g\n",base.x, *v, *v2);
16}
17
18void testArray() {
19 int a[2];
20 a[0] = 1;
21 a[1] = 2;
22 int* p = &a[0];
23 int* p2 = a;
24 printf("testArray: %d %d %d\n", a[0], *p, *p2);
25}
26
27int main() {
28 testStruct();
29 testArray();
30 return 0;
31}