C.h to D conversion (structs)

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 15 10:10:03 PDT 2016


On Tuesday, 15 March 2016 at 16:56:00 UTC, Chris wrote:
> Do you mean I need to void initialize them in the C code or in 
> D? And if in D, how would I do that, with `static this`?

in D, at the usage point with =void where you declare the 
variable of that type. So in your code:

struct C
{
   A a = void;
   B b = void;
}

though I'm pretty sure it wouldn't matter in this specific 
instance because they would be all zeroes anyway... your real 
code probably has a char or a float in it, right?



I do not recommend trying that though, it is better to actually 
compile+link in the modules.


More information about the Digitalmars-d-learn mailing list