On Wed, Feb 6, 2013 at 10:07 AM, Diogo F. S. Ramos <[email protected]> wrote:
> How do I fill a char array, inside a cstruct, with a byte string?
>
> I'm using the following code to do it, but is there a better way?
Hi Diogo,
I'm also beginning to use the FFI, and starting to collect examples for use.
Here's your example:
https://github.com/dyoo/ffi-tutorial/tree/master/ffi/tutorial/examples/struct-with-array
The core files you can take a look at are:
The FFI code:
https://github.com/dyoo/ffi-tutorial/blob/master/ffi/tutorial/examples/struct-with-array/struct-with-array.rkt
and the usage:
https://github.com/dyoo/ffi-tutorial/blob/master/ffi/tutorial/examples/struct-with-array/test-struct-with-array.rkt
Best of wishes!
____________________
Racket Users list:
http://lists.racket-lang.org/users