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

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -