I have very little experience writing C# code, but I want to make a robust Windows GUI for some of my code. I was wondering if the following code was pass by value or by reference. Specifically if bytes[] is copied before it is passed to mystery? Do I need an explicate ref statement in the extern?
[DllImport("unSHA.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern void time(byte[] bytes);
Parameters are always passed by value, unless you use the
reforoutkeyword.An array is a reference type, so the value that is passed is a copy of the reference to the array.