array[i] = (Complex) Structure.newInstance(Complex.class, new Pointer(Pointer.nativeValue(p) + i * SIZE));
the cast shouldn't be necessary, the method definition should be
public static <T extends Structure> T newInstance(Class<T> type, Pointer init) throws IllegalArgumentException { ... }
the cast shouldn't be necessary, the method definition should be
public static <T extends Structure> T newInstance(Class<T> type, Pointer init) throws IllegalArgumentException { ... }