fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a=1;
  5. int b=2;
  6.  
  7. int *p[2];
  8.  
  9. p[0]=&a;
  10. p[1]=&b;
  11.  
  12. printf("変数a : %p , %d \n", &a , a );
  13. printf("変数b : %p , %d \n", &b , b );
  14.  
  15. for(size_t i=0;i<2;i++){
  16. printf("ポインタの配列p[%zu] : %p , %d \n", i ,p[i],*p[i] );
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 544KB
stdin
Standard input is empty
stdout
変数a : 0x7ffdba4ee9b0 , 1 
変数b : 0x7ffdba4ee9b4 , 2 
ポインタの配列p[0] : 0x7ffdba4ee9b0 , 1 
ポインタの配列p[1] : 0x7ffdba4ee9b4 , 2