I am an embedded C programmer and was integrating my code written in native C/C++ with Java using JNI. I was curios to know whether pass by reference for primitive data_type be possible? I am refering this link http://java.sun.com/docs/books/jni/html/objtypes.html#5279 which doesnt help my cause.
Basically what i want to achieve is something like this : // Get the val updated by the native call int nativeFunc(short val); Java Function :
class main
{
short val;
val = 0;
nativeFunc(val);
System.out.println(val)
}
int nativeFunc(short val)
{
// Code to update OUt param val
// Need this portion
}
I dont know if its very trivial question with a very easy answer.