Passing D arrays to a C interface

Simen Haugen simen at norstat.no
Tue Nov 6 04:41:38 PST 2007


"David Brown" <dlang at davidb.org> wrote in message 
news:mailman.0.1194283572.2338.digitalmars-d at puremagic.com...
> On Mon, Nov 05, 2007 at 10:13:22AM +0100, torhu wrote:
>
>> D dynamic arrays are not (portably) link-compatible with anything in C. 
>> Most of the time you would get away with pretending they are a 'struct 
>> dynarray { size_t len; void* data; };'  But it's probably better to pass 
>> the size and the pointer separately, like in the example.
>
> Especially best to not use this, since Walter seems to be thinking of
> changing this representation.

In v.1 too?!





More information about the Digitalmars-d mailing list