I'm new to C# - I'm from the C school of coding. I am writing a front end in C# that connects via a DLL to some CUDA GPU code. I need to pass an array of structs to the DLL. I first need to figure out how to create a pointer to the array of structs.
For example, I have a simple struct
public struct cNum
{
public int x,y;
}
Inside my main func, I have:
cNum[] c = new cNum[10];
How would I create a pointer to the array above that I could then send to my DLL? I know about the unsafe{} requirement, and I've successfully used pointers to pass and modify data in my DLL.
Any help would be greatly appreciated!