fork download
  1. #include <stdio.h>
  2. #include <stddef.h>
  3. int main(void) {
  4. struct s {
  5. char c;
  6. double d;
  7. } x;
  8. struct a {
  9. double d;
  10. char c;
  11. } y;
  12. printf("%lu %lu\n",(unsigned long)sizeof x,(unsigned long)sizeof y);
  13. printf("%lu %lu",(unsigned long)offsetof(struct s,d),(unsigned long)offsetof(struct a,c));
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
12 12
4 8