diff options
Diffstat (limited to 'libacc/tests/data/addressOf.c')
-rw-r--r-- | libacc/tests/data/addressOf.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/libacc/tests/data/addressOf.c b/libacc/tests/data/addressOf.c deleted file mode 100644 index e7acde5..0000000 --- a/libacc/tests/data/addressOf.c +++ /dev/null @@ -1,31 +0,0 @@ -void testStruct() { - struct str { - float x; - float y; - }; - - struct str base; - int index = 0; - - base.x = 10.0; - struct str *s = &base; - - float *v = &(*s).x; - float *v2 = &s[index].x; - printf("testStruct: %g %g %g\n",base.x, *v, *v2); -} - -void testArray() { - int a[2]; - a[0] = 1; - a[1] = 2; - int* p = &a[0]; - int* p2 = a; - printf("testArray: %d %d %d\n", a[0], *p, *p2); -} - -int main() { - testStruct(); - testArray(); - return 0; -} |