Can bit-fields only be fields of a structure/union, never “normal”, “stand-alone” variables?
n with bit-fields we can only use char and int?
thanks cubbi for reply.
but in your reference link also bit field use with structure.
why we can not use it “stand-alone”?
What would that accomplish?
A bit field that is not part of a struct would presumably occupy a full word so why not just use an integral type?
By forcing bit fields to be members of a struct, it becomes clear how the bits are packed.