Instantiate C struct on heap

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Aug 4 16:54:23 PDT 2016


On Thursday, 4 August 2016 at 23:49:26 UTC, Mike Parker wrote:

>
> C structs can be created with new just like D structs as long

For clarity, in a D binding to a C library, a C struct *is* a D 
struct. If they are declared as extern(C), that affects the name 
of the symbol and how it exists in the namespace (e.g. 
foo.bar.mystruct becomes simply mystruct), but nothing more. None 
of the Derelict packages do that, though.


More information about the Digitalmars-d-learn mailing list