title: How to pass a pointer to a struct array to a function in java using JNA?
body: <p>I need to pass pointer of an array of <code>IplImage</code> 
  (<code>IplImage extends CvArray extends Structure implements cloneable</code>) to a function The native code in C is as follows:</p>
  
  <pre><code>cvCalcEigenObjects(
    nTrainFaces,
    (void*)faceImgArr,
    (void*)eigenVectArr,
    CV_EIGOBJ_NO_CALLBACK,
    0,
    0,
    &amp;calcLimit,
    pAvgTrainImg,
    eigenValMat-&gt;data.fl);
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>cvCalcEigenObjects(
    nTrainFaces,
    faceImgArr[0].getPointer(),
    eigenVectArr[0].getPointer(),
    CV_EIGOBJ_NO_CALLBACK,
    0,
                  null,
    calcLimit,
    pAvgTrainImg,
    eigenValMat.data.getFloatArray(0, Pointer.SIZE));
  </code></pre>
  
  <p>but it didn't work. The declaration of this function in Java is like this:</p>
  
  <pre><code>public static void cvCalcEigenObjects(int i, 
    Pointer pntr, 
    Pointer pntr1, 
    int i1, 
    int 2, 
    Pointer pntr2, 
    cxcore.CvTermCriteria ctc, 
    cxcore.IplImage ii, 
    FloatBuffer fb)
  </code></pre>