[Tfug] OT: sizeof *part* of a struct

Bexley Hall bexley401 at yahoo.com
Thu Apr 1 13:43:34 MST 2010


Hi,

I'm trying to find safe syntax for the following:

typedef struct foo {
  blah-blah-blah;
  union {
     stuff
     otherstuff
  } payload;
} Foo;

#define OVERHEAD (sizeof(Foo) - sizeof(Foo.payload))

Suggestions?

Thx,
--don


      




More information about the tfug mailing list