分类: C/C++
2011-02-14 17:50:49
1 #include
2
3 struct bit {
4 unsigned char bit1:1;
5 unsigned char bit2:1;
6 unsigned char bit3:1;
7 unsigned char bit4:1;
8
9 unsigned char bit5:1, bit6:1, bit7:1, bit8:1;
10
11 unsigned char bit9:1;
12 } BIT;
13
14 int main()
15 {
16 // int b:2;
19
20 // return 0;
21
22 printf("sizeof(struct bit) = %d\n", sizeof(struct bit));
23 BIT.bit1 = 1;
-- VISUAL -- 1,1 Top