D
Dan Pop
In said:I e-mailed Jacob and he replied that 'it would have been
better to say sizeof(struct) + 67, instead of sizeof(int). There
could be some obscure reasons for sizeof structure != sizeof int.'
Which doesn't necessarily mean that the padding is inserted *before*
the array.
So, originally he *did* mean to say that the 67 bytes would all
end up in the char array.
I was commenting about what he wrote, not about what he meant (I'm not
a mind reader) and what he wrote is still technically correct.
In 99% of the cases this is correct
for this struct when using sizeof(int), he also wrote. Once again:
it was this C-spec 1% my initial reply was about.
I claim it's 100% versus 0% as the padding *between* the two members is
purely theoretical. Feel free to prove me wrong, by mentioning an
*existing* *real world* implementation that inserts padding there.
Of course, this doesn't mean that correct code should use sizeof(int)
instead of sizeof(somestruct).
Dan