title: How can I pass a pointer to array of pointers to structs from python
body: <p>I am using ctypes in Python and I need to pass a pointer to an array of pointers to structs to some C function.
  This is struct:</p>
  
  <pre><code>typedef struct {
      float x;
      float y;
      float z;
      float radius;
  } Sphere;
  </code></pre>
  
  <p>And I have function with the following prototype:</p>
  
  <pre><code>void render(Sphere** spheres);
  </code></pre>
  
  <p>In Python I declared a class for the Sphere struct and I need to set argtypes to the <code>render</code> function:</p>
  
  <pre><code>lib_render = ctypes.cdll.LoadLibrary('librender.so')
  
  class Sphere(ctypes.Structure):
      _fields_ = [('x', ctypes.c_float),
                  ('y', ctypes.c_float),
                  ('z', ctypes.c_float),
                  ('radius', ctypes.c_float)]
  
  render = lib_render.render
  render.argtypes = [&lt;cannot find out what needs to be here&gt;]
  
  spheres = numpy.array([Sphere(1, 2.8, 3, 0.5),
                         Sphere(4.2, 2, 1, 3.2)])
  render(spheres)
  </code></pre>
  
  <p>How to pass that array correctly?</p>