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. // ここまでで、int型の配列(長さ4)ができた。
  8. for(int i=0;i<5;i++){
  9. a[i]=(double)i/10;}
  10. for(int i=0;i<5;i++)
  11. printf("a[%d]=%lf,%x\n",i,a[i],&(a[i]));
  12.  
  13.  
  14.  
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5548KB
stdin
Standard input is empty
stdout
a[0]=0.000000,75ccb260
a[1]=0.100000,75ccb268
a[2]=0.200000,75ccb270
a[3]=0.300000,75ccb278
a[4]=0.400000,75ccb280