fork(1) download
  1. #include <stdio.h>
  2.  
  3. struct tt
  4. {
  5. double a;
  6. long b;
  7. int c;
  8. char d;
  9. };
  10.  
  11. int main(void) {
  12. struct tt t;
  13. printf("1) sizeof(t)=%d", sizeof(t));
  14. struct tt * tp;
  15. printf("\n2) sizeof(tp)=%d", sizeof(tp));
  16. struct tt * t_arr = (struct tt*)malloc(10*sizeof(struct tt));
  17. printf("\n3) sizeof(t_arr)=%d", sizeof(t_arr));
  18. printf("\n4) sizeof(t_arr[0])=%d", sizeof(t_arr[0]));
  19. struct tt ** tp_arr = (struct tt**)malloc(10*sizeof(struct tt*));
  20. printf("\n5) sizeof(tp_arr)=%d", sizeof(tp_arr));
  21. printf("\n6) sizeof(tp_arr[0])=%d", sizeof(tp_arr[0]));
  22.  
  23. return 0;
  24.  
  25. }
  26.  
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
1) sizeof(t)=20
2) sizeof(tp)=4
3) sizeof(t_arr)=4
4) sizeof(t_arr[0])=20
5) sizeof(tp_arr)=4
6) sizeof(tp_arr[0])=4