I’ve been handed a Byte[] that contains a file. I need to pass this to another method that is expecting two parameters, a char* to the beginning of the file and a char* to the end of the file.
I’m assuming I need to pin the array first so it doesn’t get collected. I don’t imagine I can then just cast the first and last elements, right?
Old question, but I just found out that you can create a
pin_ptr<unsigned char>from such an array and thenreinterpret_castthe result.You can then use a reinterpret_cast on the result