title: How to use NumPy array with ctypes?
body: <p>I am still writing on a python interface for my c code with ctypes. Today I substituted my file reading function with a python version, which was programmed by somebody else using NumPy. The 'old' c version was called with a <code>byref(p_data)</code> while <code>p_data=PFloat()</code> (see below). The main function takes the <code>p_data</code>.</p>
  
  <p>Old file reading:</p>
  
  <pre><code>p_data=POINTER(c_float)
  foo.read(filename,byref(p_data))
  result=foo.pymain(p_data)
  </code></pre>
  
  <p>The python file reading function, on the other hand, returns a NumPy array. My question now is: </p>
  
  <p>How do I convert a NumPy array to <code>POINTER(c_float)</code>?</p>
  
  <p>I googled but only found the other way around: <a href="http://www.kloss-familie.de/blog/article.php?story=20090114054107645" rel="noreferrer">C arrays through ctypes accessed as NumPy arrays</a> and things I didn't understand: <a href="http://docs.scipy.org/doc/numpy/reference/routines.ctypeslib.html" rel="noreferrer">C-Types Foreign Function Interface (numpy.ctypeslib)</a></p>
  
  <p><strong>[update]</strong>
  corrected a mistake in the example code</p>