Fri May 08, 2009 7:09 am
Assuming 32 bit compiler, Unsigned int will take 4 bytes
Struct mystruct
{
unsigned int bit0 : 1;
unsigned int bit0 : 1;
unsigned int bit0 : 1;
unsigned int bit0 : 1;
unsigned int bit0 : 1;
unsigned int bit0 : 1;
unsigned int bit0 : 1;
unsigned int bit0 : 1;
}a;
I have the doubt,whether the sizeof structure is 1 byte or 4 byte?
Is sizeof(a)=1 or sizeof(a)=4?
Sun May 10, 2009 12:28 am
Sun May 10, 2009 11:08 am
biskot188 wrote:its 8 that means that its 4 bytes
I have compiled the progrma and printed the sizeof(a).It is 1 byte.Not 4 bytes. Why is this so..
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.