C-位域
struct { unsigned char x1 : 2; unsigned char x2 : 2; unsigned char x3 : 2; unsigned char x4 : 2; } Bunch; /* sizeof(Bunch) => 1 */
struct { unsigned char x1: 2; unsigned char x2: 2; unsigned char : 0; /* 下一个位域在内存分配边界对齐 */ unsigned char x4: 2; } Bunch; /* sizeof(Bunch) => 2 */
参考:http://www.qtbig.com/page/5/
长风破浪会有时,直挂云帆济沧海!
可通过下方链接找到博主
https://www.cnblogs.com/judes/p/10875138.html