Im using a C++ DLL for my C# project, DLL has a class inside which is created and destroyed by outer functions such as:
class myClass
{
int N;
public:
//some elements and some 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 are in extern "C" {} body.
How does the compiler let me use C++ features is "C" space? Isnt it for only C code? This is tested and works(Ive started making an opencl wrapper for C#). I was using only pure C codes before.