fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. struct test1 {char p:4; unsigned char q:4;};
  6. struct test2 {int p:4; int q:4; char c;};
  7. struct test3 {int p:4; unsigned int q:4;};
  8. struct test4 {int p:4; unsigned char q:4;};
  9. printf("%d %d %d %d\n", sizeof(test1), sizeof(test2), sizeof(test3), sizeof(test4));
  10. }
Success #stdin #stdout 0s 2728KB
stdin
Standard input is empty
stdout
1 4 4 4