fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void) {
  5. double* a;
  6. a = (double *)malloc(8*5);
  7. for(int i=0;i<5;i++){
  8. a[i]=(double)i/10.0;
  9. printf("a[%d]のアドレス:%p\n",i,&a[i]);
  10. printf("a[%d]の値:%lf\n",i,a[i]);
  11. }
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
a[0]のアドレス:0x55ba51e86260
a[0]の値:0.000000
a[1]のアドレス:0x55ba51e86268
a[1]の値:0.100000
a[2]のアドレス:0x55ba51e86270
a[2]の値:0.200000
a[3]のアドレス:0x55ba51e86278
a[3]の値:0.300000
a[4]のアドレス:0x55ba51e86280
a[4]の値:0.400000