dcsimg
Problem of compatability between int and jint.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Surendra_Lingareddy
Posted On:   Thursday, August 9, 2001 10:35 AM

I have some method in C that accesses Java layer using JNI. My main function calls this method which takes a parameter by reference. main() { int a; double b; x = someFunc(a, &b); } int someFunc(a, *b) { a = someVal; jdouble myB; myB = (*env)->CallObjectMethod (env,jref,jmethodID, a); return a; } My question is : If myB is the value that I want the parameter b to be assigned to, what should do in there. If I directly assign b = myB; it says incompatible and yells at me. Is double and jdouble interchangeable? I was assuming that primitive types were interchangeable. Ple   More>>

I have some method in C that accesses Java layer using JNI. My main function calls this method which takes a parameter by reference.


main() {

int a;

double b;

x = someFunc(a, &b);

}



int someFunc(a, *b) {

a = someVal;

jdouble myB;

myB = (*env)->CallObjectMethod (env,jref,jmethodID, a);

return a;

}

My question is : If myB is the value that I want the parameter b to be assigned to, what should do in there. If I directly assign b = myB; it says incompatible and yells at me. Is double and jdouble interchangeable? I was assuming that primitive types were interchangeable.
Please advise.
Thanks,
Surendra.

   <<Less

Re: Problem of compatability between int and jint.

Posted By:   Surendra_Lingareddy  
Posted On:   Thursday, August 9, 2001 03:25 PM

Hey sorri for the question folks. It was the pointer error. It should have been *area. I was dereferencing and using it. My bad!
About | Sitemap | Contact