Re: using sizeof

2007-09-20 Thread Mike McCarty
Jon Dowland wrote: Because sizeof is not really the size of the struct, it is the distance between adjacent structs in an array. Alignment forces the extra bytes I'm not quite sure I get what you're saying here. Yes, alignment pads out the structure. But I'm not sure where arrays come into it

Re: Re: using sizeof

2007-07-16 Thread Jon Dowland
> Because sizeof is not really the size of the struct, it is > the distance between adjacent structs in an array. > Alignment forces the extra bytes I'm not quite sure I get what you're saying here. Yes, alignment pads out the structure. But I'm not sure where arrays come into it :- sizeof(struct

Re: using sizeof

2007-07-16 Thread Hendrik Boom
On Mon, 14 May 2007 16:24:59 +, J HU wrote: > Dear all, > > Perhaps it's an easy/silly question but I don't understand how it works. > > (I'm working in a debian) > I have declared a structure and I'm using the "sizeof" to get the size of > this structure. > > After the call I get that the

Re: using sizeof

2007-05-14 Thread Nelson Castillo
On 5/14/07, J HU <[EMAIL PROTECTED]> wrote: Dear all, Perhaps it's an easy/silly question but I don't understand how it works. (I'm working in a debian) I have declared a structure and I'm using the "sizeof" to get the size of this structure. After the call I get that the total size is 64Bytes

Re: using sizeof

2007-05-14 Thread Tyler MacDonald
J HU <[EMAIL PROTECTED]> wrote: > I have declared a structure and I'm using the "sizeof" to get the size of > this structure. > > After the call I get that the total size is 64Bytes but if I get the size > of each field and I add them manually I get that it should be 61Bytes... > > Anyone knows

using sizeof

2007-05-14 Thread J HU
Dear all, Perhaps it's an easy/silly question but I don't understand how it works. (I'm working in a debian) I have declared a structure and I'm using the "sizeof" to get the size of this structure. After the call I get that the total size is 64Bytes but if I get the size of each field and I