1 struct A { 2 unsigned char x; 3 unsigned b1 : 1; 4 unsigned b2 : 1; 5 unsigned b3 : 1; 6 unsigned b4 : 1; 7 unsigned b5 : 1; 8 unsigned b6 : 1; 9 unsigned b7 : 1; 10 unsigned b8 : 1; 11 unsigned b9 : 1; 12 unsigned b10 : 1; 13 unsigned char y; 14 }; 15 16 struct B { 17 unsigned foo : 31; 18 unsigned char bar : 1; 19 }; 20 21 struct C { 22 unsigned char x; 23 unsigned b1 : 1; 24 unsigned b2 : 1; 25 unsigned baz; 26 }; 27 28 struct Date1 { 29 unsigned short nWeekDay : 3; // 0..7 (3 bits) 30 unsigned short nMonthDay : 6; // 0..31 (6 bits) 31 unsigned short nMonth : 5; // 0..12 (5 bits) 32 unsigned short nYear : 8; // 0..100 (8 bits) 33 }; 34 35 struct Date2 { 36 unsigned short nWeekDay : 3; // 0..7 (3 bits) 37 unsigned short nMonthDay : 6; // 0..31 (6 bits) 38 unsigned short nMonth : 5; // 0..12 (5 bits) 39 unsigned short nYear : 8; // 0..100 (8 bits) 40 unsigned char byte : 8; 41 }; 42 43 struct Date3 { 44 unsigned short nWeekDay : 3; // 0..7 (3 bits) 45 unsigned short nMonthDay : 6; // 0..31 (6 bits) 46 unsigned short nMonth : 5; // 0..12 (5 bits) 47 unsigned short nYear : 8; // 0..100 (8 bits) 48 unsigned char byte; 49 }; 50