How to: Obtain a Pointer to Byte Array
You can obtain a pointer to the array block in a Byte array by taking the address of the first element and assigning it to a pointer.
Example
// pointer_to_Byte_array.cpp
// compile with: /clr
using namespace System;
int main() {
Byte bArr[] = {1, 2, 3};
Byte* pbArr = &bArr[0];
array<Byte> ^ bArr2 = gcnew array<Byte>{1,2,3};
interior_ptr<Byte> pbArr2 = &bArr2[0];
}
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for