visual c++ - How to Convert from unsigned char* to array<unsigned char>^? -
how convert array of unsigned chars
array<unsigned char>^ ?
thanks in advance!
just create managed array, , copy data. simple.
array<byte>^ makemanagedarray(unsigned char* input, int len) { array<byte>^ result = gcnew array<byte>(len); for(int = 0; < len; i++) { result[i] = input[i]; } return result; }
yes, i'm sure there's way use marshal class copy you, or pointer managed array can pass memcpy
, works, , doesn't require research on msdn verify it's correct.
Comments
Post a Comment