I'm making a dll in c++ and I want to pass an array to a c# program. I already managed to do this with single variables and structures. Is it possible to pass an array too?
I'm asking because I know arrays are designed in a different way in those two languages and I have no idea how to 'translate' them.
In c++ I do it like that:
extern "C" __declspec(dllexport) int func(){return 1};
And in c# like that:
[DllImport("myDLL.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "func")]
public extern static int func();