Hi,
In this case structure padding will occur due to bit alignment..
To avoid this clause...take a instance of that structure as a pointer type
and
store every field. then dereference it according to data type what we have
defiend in the structure field.
Because we know the size of pinter id 4 byte...
Note : this is gud , if we take int in the structure as a char array of 4
byte.
-Ravi
On 27 Mar 2007 06:58:19 -0700, Thomas Hruska <[EMAIL PROTECTED]>
wrote:
>
> rshankar_gupta wrote:
> > hi,can any one explain about structure paddig
> >
> > and what will be the size of this program with structure padding
> >
> > stucture foo
> > {
> > char c;
> > int a;
> > float b;
> > };
> >
> > whether it will vary with 16/32 bit compilers
>
> sizeof(foo);
>
> If it matters what size it is, you can use #pragma options. Most
> compilers offer #pragma directives to alter structure alignment rules.
> Most of the time, the size of the structure shouldn't matter.
>
> --
> Thomas Hruska
> CubicleSoft President
> Ph: 517-803-4197
>
> *NEW* VerifyMyPC 2.3
> Change tracking and management tool.
> Reduce tech. support times from 2 hours to 5 minutes.
>
> Free for personal use, $10 otherwise.
> http://www.CubicleSoft.com/VerifyMyPC/<http://www.cubiclesoft.com/VerifyMyPC/>
>
>
>
[Non-text portions of this message have been removed]