fork download
  1. #include <cstdio>
  2. #include <cstdint>
  3.  
  4. struct foo
  5. {
  6. float f;
  7. std::int16_t i;
  8. };
  9.  
  10. struct bar
  11. {
  12. float f;
  13. std::int16_t i;
  14. std::int16_t j;
  15. };
  16.  
  17. int main() {
  18. printf("%zu\n", sizeof(float));
  19. printf("%zu\n", sizeof(std::int16_t));
  20. printf("%zu\n", sizeof(foo));
  21. printf("%zu\n", sizeof(bar));
  22. return 0;
  23. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
4
2
8
8