A
andrew queisser
Is the following code valid C?
typedef struct
{
char x[128];
} foo;
typedef struct
{
char sameSizeAsFooX[ sizeof ((foo *)0)->x ];
} bar;
I'd like to use this construct to ensure keeping member sizes in two
structures in lockstep but I'm not sure if it's really portable.
Thanks,
Andrew
typedef struct
{
char x[128];
} foo;
typedef struct
{
char sameSizeAsFooX[ sizeof ((foo *)0)->x ];
} bar;
I'd like to use this construct to ensure keeping member sizes in two
structures in lockstep but I'm not sure if it's really portable.
Thanks,
Andrew