[racket] Filling char arrays inside cstructs

From: Danny Yoo (dyoo at hashcollision.org)
Date: Wed Feb 6 16:22:29 EST 2013

On Wed, Feb 6, 2013 at 10:07 AM, Diogo F. S. Ramos <diogofsr at gmail.com> 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:


The core files you can take a look at are:

The FFI code:


and the usage:


Best of wishes!

Posted on the users mailing list.