Creating array of structs being used in C interface
Stefan Koch via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Nov 27 07:56:13 PST 2016
On Sunday, 27 November 2016 at 15:23:33 UTC, Timoses wrote:
> On Sunday, 27 November 2016 at 14:27:54 UTC, Adam D. Ruppe
> wrote:
>> That's because int is zero initialized by default and thus
>> doesn't need anything more than a call to zero memory
>> function, and double isn't (it is NaN), so it gets an
>> initializer data blob. If you make it = 0 it might work, but
>> even then, the compiler may want to reference the initializer
>> just because there's a non-default init value!
>
>
> Does your answer also explain why it works when I move the
> mytypes.d into the source/ folder?
dub will link it in when it is in the source folder.
More information about the Digitalmars-d-learn
mailing list