Good day, I am trying to copy a Java string array to C++ array using JNI. I have tried this but does not seem to be working.
char *myarray;
JNIEXPORT void JNICALL
Java_com_Example_accessArray(JNIEnv *env, jobject obj, jobjectArray stringArrays){
int size;
size = env->GetArrayLength(stringArrays);
myarray = env->GetCharArrayRegion(stringArrays, 0, size, null);
}
Does the myarray hold the same values in the Java array passed? Or how can I copy the values of the java String array passed through JNI to a C++ array, so the array in C++ holds the same vale? Thanks in advance.