title: Confirmation I am sending the pointer to int[] correctly in Java JNA
body: <p>I am passing a pointer to an int[] as here, which is in my structure/class in java see below:</p>
  
  <pre><code>        int[] initialDynamicSize = new int[]{1, initialDynamicAllocatedSize};
          int[] allFloorsSize = new int[]{1, allFloorsAllocatedSize};
  
          Pointer PTRinitialDynamicSize = new Memory(2*Native.getNativeSize(Integer.TYPE));
          PTRinitialDynamicSize.setInt(0*Native.getNativeSize(Integer.TYPE),1);
          PTRinitialDynamicSize.setInt(1*Native.getNativeSize(Integer.TYPE),initialDynamicAllocatedSize);
  
          Pointer PTRallFloorsSize = new Memory(2*Native.getNativeSize(Integer.TYPE));
          PTRinitialDynamicSize.setInt(0*Native.getNativeSize(Integer.TYPE),1);
          PTRallFloorsSize.setInt(1*Native.getNativeSize(Integer.TYPE),allFloorsAllocatedSize);
  </code></pre>
  
  <p>The structure looks like this:</p>
  
  <pre><code>@Structure.FieldOrder({ "str", "size", "allocatedSize", "numDimensions", "canFreeData"})
  public class test extends Structure implements Structure.ByReference{
  
  
      public Pointer str;
      //private int numVals;
      public Pointer size;
      public int allocatedSize;
      public int numDimensions;
      public boolean canFreeData;
  
      //Static
      public test(Pointer str, Pointer size) {
          this.str = str;
          this.size = size;
      }
  
      //Dynamic
      public test(Pointer str, Pointer size, int allocatedSize, int numDimensions, boolean canFreeData) {
          this.str = str;
          this.size = size;
          this.allocatedSize = allocatedSize;
          this.numDimensions = numDimensions;
          this.canFreeData = canFreeData;
      }
  
      public test() {
      }
  }
  </code></pre>
  
  <p>I am getting errors back from my C code, i want to rule out any errors with this code. the C code struct that receives the data is:</p>
  
  <pre><code>struct emxArray_char_T
  {
    char *data;
    int *size; // This is the string array that i am sending
    int allocatedSize;
    int numDimensions;
    bool canFreeData;
  };
  </code></pre>
  
  <p>This is a MatLab Struct <a href="https://uk.mathworks.com/help/coder/ug/use-c-arrays-in-the-generated-function-interfaces.html#mw_0cae9a4a-b74d-43f9-aae0-ed192db73d22" rel="nofollow noreferrer">https://uk.mathworks.com/help/coder/ug/use-c-arrays-in-the-generated-function-interfaces.html#mw_0cae9a4a-b74d-43f9-aae0-ed192db73d22</a></p>