fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void){
  5.  
  6. double *a;
  7. a=(double*)malloc(sizeof(double)*4);
  8.  
  9. for(int i=0;i<5;i++){
  10. a[i]=i/10;
  11. }
  12.  
  13. for(int i=0;i<5;i++){
  14. printf("a[%d]のアドレスは%p a[%d]=%lf \n",i,&a[i],i,a[i]);
  15. }
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
a[0]のアドレスは0x55cc13ddc260 a[0]=0.000000 
a[1]のアドレスは0x55cc13ddc268 a[1]=0.000000 
a[2]のアドレスは0x55cc13ddc270 a[2]=0.000000 
a[3]のアドレスは0x55cc13ddc278 a[3]=0.000000 
a[4]のアドレスは0x55cc13ddc280 a[4]=0.000000