Hi,
how to copy the 2D array to java from C which connected with
JNI.
i used following statement 1D array which was worked very
fine..
(*env)->SetDoubleArrayRegion(env,ans,0,len,res);
ans -> 2D array declared in Java
res -> 2D array declared in C
when i changed the dimension i got following warning
which making shared lib..
: warning: passing argument 5 of '(*env)-
>SetDoubleArrayRegion' from incompatible pointer type
What should i do to pass 2d array to java from C.. how do
remove this warning .
Please any one of you help me out to solve..
Thanks in advance,
Ganesh.
Gordon Beaton - 08 Mar 2007 09:46 GMT
> how to copy the 2D array to java from C which connected with
> JNI.
[...]
> : warning: passing argument 5 of '(*env)->SetDoubleArrayRegion' from
> incompatible pointer type
Each element of the 2D array is itself a 1D array. The 2D array is
array-of-Object, not array-of-Double.
You need to do this 1 array at a time, i.e. iterate over the 2D array,
then handle each element just like the 1D case.
/gordon

Signature
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e