I want to pass a byte[] to a method takes a IntPtr Parameter in C#, is that possible and how?
byte[]
IntPtr
Another way,
GCHandle pinnedArray = GCHandle.Alloc(byteArray, GCHandleType.Pinned); IntPtr pointer = pinnedArray.AddrOfPinnedObject(); // Do your stuff... pinnedArray.Free();
2.1m questions
2.1m answers
60 comments
57.0k users