c# - "New" operator works in extern "C" -
im using c++ dll c# project, dll has class inside created , destroyed outer functions such as:
class myclass { int n; public: //some elements , functions myclass(int n) { n=n; } }; __declspec(dllexport) myclass * builderf(int n) { return new myclass(n); } __declspec(dllexport) void destroyerf(myclass * c) { delete c; }
and these in extern "c" {} body.
how compiler let me use c++ features "c" space? isnt c code? tested , works(ive started making opencl wrapper c#). using pure c codes before.
extern "c"
doesn't change compiler c compiler. says functions (or pointers functions) use c conventions in interface. can still in c++ in functions; it's things name mangling , calling conventions affected.
Comments
Post a Comment