fork download
  1. #include <stdio.h>
  2.  
  3. struct s1 {
  4. int a : 6;
  5. _Bool b : 1;
  6. _Bool c : 1;
  7. _Bool d : 1;
  8. _Bool e : 1;
  9. _Bool f : 1;
  10. _Bool g : 1;
  11. int h : 12;
  12. };
  13.  
  14. struct s2 {
  15. int a : 6;
  16. _Bool b;
  17. _Bool c;
  18. _Bool d;
  19. _Bool e;
  20. _Bool f;
  21. _Bool g;
  22. int h : 12;
  23. };
  24.  
  25. int main(void) {
  26. printf("sizeof(struct s1) = %d\n", sizeof(struct s1));
  27. printf("sizeof(struct s2) = %d\n", sizeof(struct s2));
  28. }
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
sizeof(struct s1) = 4
sizeof(struct s2) = 12