Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.
Bit fields memory aligment with unsigned int, short int.
struct {
int a : 8;
int b : 10;
int c : 12;
int d : 4;
int e : 3;
int : 0;
int f : 1;
char g;
} A;
The size of bitfields memory is 48bits.
The size of structure should be 4+4+1 bytes = 9 bytes. What about the memory for variable g. why memory for g is not allocated separately. When I compiled it is showing 8 bytes.
Can any one give clarity on the size of structure
This Question is not yet answered!
Related Answered Questions
Related Open Questions