I have a program,which reads a
String from the user.
char buf[128];
const jbyte *jnistr;
jsize strsize;
jnistr = (*env)->GetStringUTFChars(env,prompt,NULL);
if(jnistr==NULL){
return;
}
strsize = (*env)->GetStringLength(env,prompt);
testBuffer(*jnistr,strsize);
After converion, it is in the varibale jnistr ,which is a const jbyte.
My confusion starts here:
How can I pass the const jbyte to a C function, so that the whole string is accessible.
When I try to return the jnistr, and accept it as a char parameter in the C function testBuffer(), I can only read the first letter of the string and nothing beyond that.
Thank You,
Ann