Constant expressions in initializers

Shankar Unni shankar at hpclscu.HP.COM
Sat Apr 1 06:11:50 AEST 1989


> struct dummy Dummy = { offsetof(struct dummy,f),
>                        2.0 };

Also try:

   char SmallArray [ offsetof(struct dummy, f) ];

   ...
   struct something {
      int i : offsetof (struct dummy, f);
   };

   ...
   switch (i) {
      case offsetof (struct dummy, f):   break;
   }

   ...
---
Shankar Unni.



More information about the Comp.std.c mailing list