Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to transfer 1D array in JAVA to 3D array in C

807588Jul 31 2009 — edited Jul 31 2009
Here is my problem:

I am working on a project which is writen by JAVA.

In JAVA, I have a 3D volume called velocity_java:

float [][][] velocity = new float [NY][NX][NZ].

I need to use JAVA Interface to connect with my C program.

In my C program, I define velocity as 3D array velocity_c

float ***velocity; /*pointer*/
velocity = alloc3float(NY,NX,NZ). /*allocate memory*/

Could I directly do this? Or I need to redefine some arrays?

I got a suggestion said: in JAVA, define 1D array, but in C, define 3D array;

If not, how can I do this? I hope I describe the question clearly.

Thanka a lot.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2009
Added on Jul 31 2009
1 comment
196 views