struct {
unsigned lo : 1;
unsigned mid : 15;
unsigned hi : 1;
unsigned mid2 : 15;
} foo = {0x1, 0x8, 0x1};
int main()
{
unsigned int sizeofbitfield;
sizeofbitfield = sizeof(foo);
printf("size of bit fields : %d " , sizeofbitfield
); return 0;
}
c3RydWN0IHsKdW5zaWduZWQgbG8gOiAxOwp1bnNpZ25lZCBtaWQgOiAxNTsKdW5zaWduZWQgaGkgOiAxOwp1bnNpZ25lZCBtaWQyIDogMTU7Cn0gZm9vID0gezB4MSwgMHg4LCAweDF9OwoKaW50IG1haW4oKQp7CiAgICB1bnNpZ25lZCBpbnQgc2l6ZW9mYml0ZmllbGQ7CiAgICBzaXplb2ZiaXRmaWVsZCA9IHNpemVvZihmb28pOwogICAgcHJpbnRmKCJzaXplIG9mIGJpdCBmaWVsZHMgOiAlZCAiICwgc2l6ZW9mYml0ZmllbGQpOwogICAgcmV0dXJuIDA7Cn0=