title: Passing a pointer to a 1D Fortran array to C++ with C_LOC() causes garbage values
body: <p>I want to know the proper way to pass array from Fortran to C. It returns out that iso_c_binding only has C_F_pointer but no F_C_pointer. I tried to use c_loc, but I got -6.04639e-264 for the second element.</p>
  
  <p>My Fortran code is:</p>
  
  <pre><code>SUBROUTINE SIMULATION(ARRAY) BIND(C)
      USE ISO_C_BINDING
      IMPLICIT NONE
  
      TYPE (c_ptr), INTENT(INOUT) :: ARRAY
      REAL (C_DOUBLE), TARGET, SAVE :: ETA(0:1)
  
      ! Allocate an array and make it available in C
      ARRAY = C_LOC(ETA)
      ETA(0) = 1.0
      ETA(1) = 2.0
  
  END SUBROUTINE SIMULATION
  </code></pre>
  
  <p>And my C++ code is:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  using namespace std;
  
  extern "C" {
      void simulation(double* array[]);
  }
  int main()
  {
      double* array[2];
      simulation(array);
      cout &lt;&lt; *array[0] &lt;&lt; endl;
      cout &lt;&lt; *array[1] &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>