If I am not correct, the codes following are used to copy an array of bytes to a position of memory in C#:
byte[] byteName = Encoding.ASCII.GetBytes("Hello There");
int positionMemory = getPosition();
Marshal.Copy(byteName, 0, new IntPtr(positionMemory), byteName.length);
How can I achieve this in native C++?
use a pointer and memcpy:
Suppose you want to copy an array A of length n into an array B
This is more C than C++, the string class have copy capabilities you can use.
Here’s a more specific sample with a complete code:
let me know if you need more details