fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void) {
  5. double *a;
  6. a=(double*)malloc(sizeof(double)*5);
  7.  
  8. for(int i=0;i<5;i++){
  9. a[i]=(double)i/10;
  10. }
  11.  
  12. for(int i=0;i<5;i++){
  13. printf("a[%d]のアドレスは%p\n",i,&a[i]);
  14. printf("その中身は%lf\n",a[i]);
  15. }
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
a[0]のアドレスは0x55cf88847260
その中身は0.000000
a[1]のアドレスは0x55cf88847268
その中身は0.100000
a[2]のアドレスは0x55cf88847270
その中身は0.200000
a[3]のアドレスは0x55cf88847278
その中身は0.300000
a[4]のアドレスは0x55cf88847280
その中身は0.400000