fork(3) download
  1. #include <stdio.h>
  2. #include <malloc.h>
  3.  
  4. int main(void)
  5. {
  6. double** ptr = malloc( sizeof( double*[2] ) );
  7. for (int i = 0; i < 2; ++i)
  8. ptr[i] = malloc( sizeof( double[2] ) );
  9. ptr[0][0] = 76.65;
  10. ptr[0][1] = 6.45;
  11. **(ptr + 1) = 3.7;
  12. ptr[1][1] = 2.0;
  13.  
  14. printf( "%g %g\n", *ptr[0], *(*ptr + 1) );
  15. printf( "%g %g\n", **(ptr + 1), *(*(ptr + 1) + 1) );
  16. return 0;
  17.  
  18. }
Success #stdin #stdout 0s 2300KB
stdin
Standard input is empty
stdout
76.65  6.45
3.7  2