Bit-fields are a feature of the C and C++ languages to optimize the space taken by an integral member variable of a struct or class. It specifies the exact number of bits that a data member will hold, so that multiple adjacent bit-fields can be packed (condensed) into one field.