fork download
  1. #include <stdio.h>
  2.  
  3. typedef struct UserDef
  4. {
  5. char a, d, e;
  6. double b;
  7. int c;
  8. } USER_DEF;
  9.  
  10. int main(void) {
  11. USER_DEF st;
  12. printf("size of a : %d\n", sizeof(st.a));
  13. printf("size of b : %d\n", sizeof(st.b));
  14. printf("size of c : %d\n\n", sizeof(st.c));
  15.  
  16. printf("address of a : %X\n", &st.a);
  17. printf("address of b : %X\n", &st.b);
  18. printf("address of c : %X\n", &st.c);
  19. printf("address of d : %X\n", &st.d);
  20. printf("address of e : %X\n", &st.e);
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
size of a : 1
size of b : 8
size of c : 4

address of a : 331EB270
address of b : 331EB278
address of c : 331EB280
address of d : 331EB271
address of e : 331EB272