0
在Android Studio中,我使用NDK连接C++ native函数中的两个int数组。我如何在下面的代码中做到这一点?我需要填写下面的代码。提前致谢。JNI如何连接C++ native函数中的两个int数组
jintArray
Java_com_android_example_MainActivity_helloFromJNI(
JNIEnv *env,
jobject /* this */,
jintArray a, jintArray b){
jintArray c;
// How to concatenate a and b to get c, c <- a, b?
....
return c;
}
可以使用['NewIntArray'](http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html)来创建一个新的数组它可以容纳'a'和'b'的所有元素,然后将这些元素复制到新数组中。 – Michael