M
Michael B Allen
Consider the following structures:
struct bar {
int i;
float f;
unsigned char tail[1];
};
struct foo {
struct bar b1;
unsigned char _b1tail[B1N];
struct bar b2;
unsigned char _b2tail[B2N];
};
Can I rely on the order of members such that _b1tail will occupy at
least B1N bytes between b1 and b2?:
&foo->b2 - &foo->b1 >= sizeof(struct bar) + BN
So I can use &foo->b2 as the effective end of _b1tail?
Thanks,
Mike
struct bar {
int i;
float f;
unsigned char tail[1];
};
struct foo {
struct bar b1;
unsigned char _b1tail[B1N];
struct bar b2;
unsigned char _b2tail[B2N];
};
Can I rely on the order of members such that _b1tail will occupy at
least B1N bytes between b1 and b2?:
&foo->b2 - &foo->b1 >= sizeof(struct bar) + BN
So I can use &foo->b2 as the effective end of _b1tail?
Thanks,
Mike