title: Can I `fwrite` a memory view in Cython?
body: <p>Is it possible to write a numpy array to disk using a c <code>fwrite</code> function? From the Cython Memory View Documentation, I understand that "they can handle C arrays" but I do not see explicit examples of such.</p>
  
  <p>Here's what I'm trying:</p>
  
  <pre><code>cdef FILE *fptr
  fptr = fopen("data.dat", "w")
  cdef double[:] array = numpy.array([.5, 1.5, 2.5, -9, 0.0, 5])
  fwrite(array, sizeof(double), array.size, fptr)
  </code></pre>
  
  <p>But I get the following compile error:</p>
  
  <pre><code>Error compiling Cython file:
  ------------------------------------------------------------
  ...
  def write_values(file_path):
      """Tracer code to write values to a C file."""
      cdef FILE *fptr
      fptr = fopen("data.dat", "w")
      cdef double[:] array = numpy.array([.5, 1.5, 2.5, -9, 0.0, 5])
      fwrite(array, sizeof(double), array.size, fptr)
            ^
  ------------------------------------------------------------
  
  write_with_c.pyx:23:11: Cannot assign type 'double[:]' to 'const void *'
  </code></pre>
  
  <p>Is this possible to do?</p>