it seems to be the most logical conclusion.anyway can you tell me which compiler yor are trying the program upon?

guru_bo <[EMAIL PROTECTED]> wrote:


Question is
#include<stdio.h>
#include<conio.h>

void main()
{

    struct BIT
    {
      int op1:5, op2:12;
        char d1;
        int reg;
    }Bitfields;

    clrscr();

printf("%d is the size of the structure",sizeof(Bitfields));

}

What is the output

Ans is 6,
My reasoning is

Assuming int is 2 byte

op1:5          -      1, nearest byte is 5 + 3 .. 1byte
op2:12         -      2 bytes
char d1        -      1 byte
int reg        -      1 byte

is it correct    
Guru 





To unsubscribe : [EMAIL PROTECTED]





Do you Yahoo!?
The all-new My Yahoo! � Get yours free!

To unsubscribe : [EMAIL PROTECTED]




Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to