I have an application in which I need to pass an array from C # to a C ++ DLL. What is the best way to do this? I did a search on the Internet and realized that I needed to pass arrays from C # using ref. Code for it:
status = IterateCL(ref input, ref output);
Input and output arrays have a length of 20. Corresponding code in the C ++ DLL
IterateCL(int *&inArray, int *&outArray)
This works great once. But if I try to call a function from C # in a loop for the second time, the input array in C # is displayed as an array of one element. Why is this happening and please help me how can I call this function iteratively with C #.
Thanks, Rakesh.
source
share