extern (c) struct ?

Adam D. Ruppe destructionator at gmail.com
Thu Mar 8 16:03:57 UTC 2018


On Thursday, 8 March 2018 at 15:51:53 UTC, Robert M. Münch wrote:
> I have a pretty complex struct with C++ typed private members 
> etc. in it which I want to use from D.

How are you accessing it? If it is by pointer only passing it to 
methods, you can simply:

struct my_cpp_struct;

and define functions:

extern(C)
void foo(my_cpp_struct* arg);


then just declare functions you need and always use as opaque 
pointer.


More information about the Digitalmars-d-learn mailing list