Link to home
Start Free TrialLog in
Avatar of champine
champine

asked on

JNI: Returning a struct from C

I'm using JDK1.1, MSVC++

Say I have a struct in my C program:

struct foo {
        int a;
        int b;
        int *c;
}

(c is an array of ints, length b)

Is there any way using the JNI to return this to Java?

If not, what's the alternative?  Call NewObject, and pass each arg separately to the constuctor?

(code fragment if possible..)

Thanks,

M.
ASKER CERTIFIED SOLUTION
Avatar of aruns
aruns

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of champine
champine

ASKER

With a code fragment, or even pseudo-code, I'd give it an "A" rating;