Question

I intend to get in Java int a_output, so I do the following :

sample.h :

void fooA(int *a_output);

sample.i :

%module sample
%{
   #include "sample.h"
%}
%include "typemaps.i"
%apply int *OUTPUT { int *a_output };

%include "sample.h"

But in Java I get an array : int[] a_output

How should I modify my Swig interface to get int instead? Because this is the output of the function fooA and not an array...

Thank you a lot!

EDIT :

It might be a bad idea to convert the argument into int a_output in Java if it will expire outside fooAfunction. So, I need your advices as well about the best form to convert it into in Java..

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top