title: Passing an array from python to shared DLL, seeing access violation error
body: <p>The C function from DLL:</p>
  
  <pre><code>Multi(double Freq, double Power, int ports[], int Size)
  Need to pass the 3rd parameter as an array from python 
  </code></pre>
  
  <p>Tried the following different codes:</p>
  
  <p>A:</p>
  
  <pre><code>import ctypes
  pyarr = [2,3]
  arr = (ctypes.c_int * len(pyarr))(*pyarr)
  
  lp = CDLL(CDLL_file)
  lp.Multi(c_double(Freq), c_double(Power), arr ,c_int(Size))`
  </code></pre>
  
  <p>This code shows an error 
         ## exception :: access violation reading 0x00000000000</p>
  
  <p>B:</p>
  
  <pre><code>retarr = (ctypes.c_int*2)()
  retarr[0] =2
  retarr[1] =3
  
  lp = CDLL(CDLL_file)
  lp.Multi(c_double(Freq), c_double(Power), retarr ,c_int(Size))`
  </code></pre>
  
  <p>This code shows an error </p>
  
  <pre><code>## exception :: access violation reading 0x00000000000 
  </code></pre>
  
  <p>C: The same code using ctypes.byref also tried ......</p>
  
  <p>My understanding is the function expects an array as argument ,
  Tries passing an array as such as well address.
  Both cases , it didn't work
  Do anyone sees any mistake in my understanding or any other to work this out ??  </p>