fork download
  1. #include <stdio.h>
  2.  
  3. typedef struct {
  4. int a;
  5. int b[2];
  6. } test;
  7.  
  8.  
  9. void print(test *p ){
  10. printf("%p の中身:a=%d b[0]=%d b[1]=%d\n", p, p->a, p->b[0], p->b[1]);
  11. }
  12.  
  13. test g;
  14.  
  15. int main(void) {
  16. static test ls;
  17. test l;
  18.  
  19. print(&l);
  20. print(&g);
  21. print(&ls);
  22.  
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 5508KB
stdin
Standard input is empty
stdout
0x7fff1bf3f72c の中身:a=21988 b[0]=468973600 b[1]=32767
0x55e43901b028 の中身:a=0 b[0]=0 b[1]=0
0x55e43901b018 の中身:a=0 b[0]=0 b[1]=0