c++ cli - Convert native byte...? -


how can convert native byte (unsigned char) type variable managed byte array array^ in c++?

byte sdata[255]; // convert system::byte array or copy content bytearray?? how?  array<system::byte>^ bytearray; 

thankyou assiastance...

you can way:

char buf[] = "native string"; int len = strlen(buf); array<byte> ^bytearray = gcnew array<byte>(len + 2); marshal::copy( (intptr)buf, bytearray, 0, len ); 

you can find more info in this msdn article.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -