bit fields in c:
What is the output of below C program?
assume that int size in this system is 4 bytes.
printf("%d", sizeof(struct EmpStatus));
Once we allocate at least one bit field, it starts taking up entire int sized byte that is 4 bytes. it is up to the programmer if he wanted to use remaining bits in that entire 4 bytes or not. along with one bit field we have one more int (4 bytes) so it prints 4+4 (bytes) that is it prints 8..
Back To Top