Reuse C memory for D struct?

evilrat evilrat666 at gmail.com
Thu Nov 21 09:12:25 PST 2013


On Thursday, 21 November 2013 at 15:22:10 UTC, Lemonfiend wrote:
> Hi!
>
> I'm wondering if it's possible to have a struct in D which uses 
> the same pointer and memory as returned by the extern C 
> function.
> This would allow me to manipulate and use the C struct directly 
> in D code.

so what really stops you from accessing that pointer in D?
if you fear for data layout just wrap this pointer in D struct 
and give properties to accessing stuff from pointer(weird)


More information about the Digitalmars-d-learn mailing list