문제

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..

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top