Friday, November 05, 2010

Basic Types, Strings, and Arrays

Basic Types, Strings, and Arrays: "JNIEXPORT jint JNICALL
Java_IntArray_sumArray(JNIEnv *env, jobject obj, jintArray arr)
{
jint buf[10];
jint i, sum = 0;
(*env)->GetIntArrayRegion(env, arr, 0, 10, buf);
for (i = 0; i < 10; i ) {
sum = buf[i];
}
return sum;
}"