How to transfer 1D array in JAVA to 3D array in C
807588Jul 31 2009 — edited Jul 31 2009Here 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.