2
#include <stdio.h>
#include "Package_MyTester.h"
jstring Java_Package_MyTester_NMethod
(JNIEnv *env, jobject obj, jint first, jint second) {
jint result_i = first * second;
jstring result;
int x = 0;
for(x=0;x<5;x++) {
printf("%d",x);
}
return result;
}
該程序將兩個jints相乘。結果必須在jstring中。有沒有辦法將jint轉換成jstring?將jint轉換爲jstring
§3.2.3爲什麼會出現Java的' '標籤? –
@BhavikAmbani,因爲JNI是Java本地接口 – Thomas
@Thomas好吧,我知道了。謝謝 –