There are very few courses in the university that focus on the domain or even bit operators. In fact, bit operations may play a key role in algorithm optimization. & Bitwise AND | bitwise OR ^ bitwise OR ~ Bitwise inversion <left shift> shifts right are six operators. What is a bitfield? Sometimes the storage of information does not require a complete byte, but only takes up to a few or even a binary bit. To this end, a bit domain was born to save storage space and simplify data processing. Definition method: struct bit domain structure name {bit domain list}; for example, [cpp] struct bit {int x: 8; // The length is 8 int y: 2; // The length is 2 int z: 6 // The length is 6}. The preceding y and z are actually stored in one byte, but one bit field must be stored in one byte, it cannot boast bytes. If the length of z is 7, the storage of z will create a new byte. You can also customize a new byte, and use the airspace: [cpp] int: 0; www.2cto.com bit domain can be a non-bit domain name, such a bit domain is used to fill or adjust the location, because there is no name, [cpp] int: 2; [cpp] // method bit cannot be used. x = 1; bit. y = 1; bit. z = 1;