Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

copying 2d array from C JNI.

Thread view: 
ganeshamutha@gmail.com - 08 Mar 2007 09:13 GMT
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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.