G
Gordon Beaton
How can I return a string[] from a cprogram to a java program? [...]
Can someone please suggest? I am not good at C.
Create the array like this:
jclass sclass = (*env)->FindClass(env, "java/lang/String");
jobjectArray arr = (*env)->NewObjectArray(env, n, sclass, NULL);
Now you've got an array with space for n Strings, but each position in
the array is empty.
To populate the array, use SetObjectArrayElement() to put a String
reference in each position.
Then simply:
return arr;
/gordon