Skip to content

Instantly share code, notes, and snippets.

@arn-e
Last active December 11, 2015 11:08
Show Gist options
  • Save arn-e/4591253 to your computer and use it in GitHub Desktop.
Save arn-e/4591253 to your computer and use it in GitHub Desktop.
env_functions_getintarrayelements.c
int *GetIntArrayElementsFunc(struct jintArray jvm_array)
{
int size = jvm_array.size;
int *native_array = malloc(size * sizeof(int));
for (int i = 0; i < size; i ++){
native_array[i] = jvm_array.elements[i];
}
return native_array;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment