[racket] FFI Pointer to Pointer

From: Thomas Chust (chust at web.de)
Date: Sun Jun 10 13:21:25 EDT 2012

Freezerburn wrote:
> [...]
> I know I can define a _my_c_struct-pointer, but
> how do I make a pointer to that pointer to pass to the C function?
> [...]


you probably want an output parameter created using a

  (_ptr o _my_c_struct-pointer)

argument type specification in the binding of the function.

If necessary, you can also create a block of memory containing a pointer

  (malloc _my_c_struct-pointer)

and pass the returned pointer around, but that entails more manual
management overhead.


When C++ is your hammer, every problem looks like your thumb.

Posted on the users mailing list.