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. for(int i=0;i<5;i++){
  8. a[i]=i/10.0;
  9. }
  10.  
  11. for(int i=0;i<5;i++){
  12. printf("a[i]のアドレスは %p\n",&(a[i]));
  13. printf("その中身は %f\n",a[i]);
  14. }
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
a[i]のアドレスは 0x5562bfa9c260
その中身は 0.000000
a[i]のアドレスは 0x5562bfa9c268
その中身は 0.100000
a[i]のアドレスは 0x5562bfa9c270
その中身は 0.200000
a[i]のアドレスは 0x5562bfa9c278
その中身は 0.300000
a[i]のアドレスは 0x5562bfa9c280
その中身は 0.400000