How do I call a C function from Crystal which is returning a string in argument?
The C function is bool myfunction(char ** result);
I tried the following:
fun myFunction (ts : UInt8**) : Bool and to use it like this: MyLib.myFunction( pointerof(ts) )
It gives me the following error:
must be Pointer(Pointer(UInt8)), not Pointer(String)
I tried to call it as MyLib.myFunction( out ts) which gives an undefined reference to ‘myFunction’
I tried also to give a pointerof a pointer of a UInt8 which gives this error: can’t take address of pointerof(ts)