1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char** argv) { union { struct { char a:1; char b:3; char c:4; }d; unsigned char e; } f; f.e = 0xb9; printf("test %d,%d,%d\n",f.d.a,f.d.b,f.d.c); return 0; }
1
test -1,-4,-5