Passing ref T[n] to C
Mike Parker
aldacron at gmail.com
Mon Dec 9 09:19:42 PST 2013
On Monday, 9 December 2013 at 16:11:39 UTC, Jakob Ovrum wrote:
> On Monday, 9 December 2013 at 15:46:40 UTC, Mike Parker wrote:
>> Given that on the C side, foo_t[3] parameters will degrade to
>> pointers, it's just as obvious to me to declare the function
>> on the D side like so:
>>
>> extern( C ) void take_foo( foo_t* );
>>
>> That means that one need pass foo.ptr when calling the
>> function, but it doesn't really bother me.
>
> Do you mean `&foo`?
Actually, I meant to declare the parameter as int*.
More information about the Digitalmars-d-learn
mailing list