I am trying to use pinvoke to sort an array of structures inside another structure from C to C #. AFAIK, no. So instead, in the C structure, I declare ptr for my array and malloc. Problems: 1) How to declare an equivalent on the C # side? 2) How to distribute and use the equivalent on the C # side?
[EDIT]: Somehow I misinterpreted what I read elsewhere on a fixed array of objects from C #. And I can fix the size of the array in C So, ok compiled, but then I get a "link to an object not installed on an object instance" when using:
data.B[3].a = 4567;
So, after reading elsewhere what this error is, I added this method:
public void initA() { for (int i = 0; i < 100; i++) { B[i] = new A(); } }
OK compiled again, but with the same msg error.
source share