Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- JNIEXPORT void JNICALL Java_test_JNITest_printBooleans(JNIEnv * env, jobject obj, jbooleanArray array) {
- jint length = env->GetArrayLength(array);
- jboolean* jbarray = env->GetBooleanArrayElements(array, NULL);
- bool* boolArray = new bool[length];
- for(int i = 0; i < length; i++) {
- printf("%d, ", jbarray[i]);
- boolArray[i] = (jbarray[i] == JNI_TRUE);
- }
- printf("\n==================\n");
- for(int i = 0; i < length; i++) {
- printf("%i, ", boolArray[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment