annotate tests/mini/structs3.d @ 341:1bb99290e03a trunk

[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author lindquist
date Sun, 13 Jul 2008 02:51:19 +0200
parents test/structs3.d@5e69b77a5c51
children
rev   line source
lindquist@7 1 module structs3;
lindquist@7 2
lindquist@7 3 struct S
lindquist@7 4 {
lindquist@7 5 char c;
lindquist@8 6 float f;
lindquist@7 7 }
lindquist@7 8
lindquist@7 9 struct T
lindquist@7 10 {
lindquist@7 11 S s;
lindquist@7 12 long l;
lindquist@7 13 }
lindquist@7 14
lindquist@7 15 void main()
lindquist@7 16 {
lindquist@8 17 T t;
lindquist@8 18 float f = void;
lindquist@8 19 float* fp = void;
lindquist@8 20 {f = t.s.f;}
lindquist@8 21 {t.s.f = 0.0;}
lindquist@8 22 {fp = &t.s.f;}
lindquist@8 23 {*fp = 1.0;}
lindquist@8 24 {assert(t.s.f == 1.0);}
lindquist@8 25 {assert(*(&t.s.f) == 1.0);}
lindquist@8 26 {t.s.c = 'a';}
lindquist@8 27 {assert(t.s.c == 'a');}
lindquist@8 28 {t.l = 64;}
lindquist@8 29 {assert(t.l == 64);}
lindquist@7 30 }