Bit Fields
Seldome used feature
Programmer can specify explicitly the number of bits to be used.
struct infoByte {
int on:1; // one-bit value, 0 or 1
int :4; // four bit padding, not named
int type: 3; // three bit value, 0 to 7
};
Previous slide
Next slide
Back to first slide
View graphic version