title: Access np.array in ctypes struct
body: <p>I have a ctypes Structure with dynamic allocated arrays i.e.:</p>
  
  <pre><code>array_1d_double=npct.ndpointer(dtype=np.double,ndim=1,
                                 flags='CONTIGUOUS')
  class Test(Structure):
      _fields_ = ("x", array_1d_double, ..)
  
  test = Test()
  do_some_init_in_c(  for example malloc)
  </code></pre>
  
  <p>If I print  test.x I get the following output:</p>
  
  <pre><code>&lt;ndpointer_&lt;f8_1d_CONTIGUOUS object at 0x7f104dc0c3b0&gt;
  </code></pre>
  
  <p>The c structure looks roughly like this, </p>
  
  <pre><code>structure Test_s{
      double *x;....
  };
  </code></pre>
  
  <p>How is it possible to access this element like an numpy array?
  Is it maybe necessary to allocate the arrays as np.arrays instead of using malloc? What would be the proper way to do this ? </p>