1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | union aa{ int x; struct { unsigned char b0:1; unsigned char b1:1; unsigned char b2:1; unsigned char b3:1; unsigned char b4:1; unsigned char b5:1; unsigned char b6:1; unsigned char b7:1; unsigned char b8:1; unsigned char b9:1; unsigned char b10:1; unsigned char b11:1; unsigned char b12:1; unsigned char b13:1; unsigned char b14:1; unsigned char b15:1; unsigned char b16:1; unsigned char b17:1; unsigned char b18:1; unsigned char b19:1; unsigned char b20:1; unsigned char b21:1; unsigned char b22:1; unsigned char b23:1; unsigned char b24:1; unsigned char b25:1; unsigned char b26:1; unsigned char b27:1; unsigned char b28:1; unsigned char b29:1; unsigned char b30:1; unsigned char b31:1; }; };
int _tmain( int argc, _TCHAR* argv[]) { aa a; a.x = 456; printf ( "%d\n\n%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d " ,a.x, a.b31,a.b30,a.b29,a.b28,a.b27,a.b26,a.b25,a.b24,a.b23,a.b22,a.b21,a.b20,a.b19,a.b18,a.b17,a.b16,a.b15,a.b14,a.b13,a.b12,a.b11,a.b10,a.b9,a.b8,a.b7,a.b6,a.b5,a.b4,a.b3,a.b2,a.b1,a.b0); getchar (); return 0; } |