我知道如何将字节数组转换为unsigned char *。我怎么能这样做呢? 我不知道unsigned char *的长度。
我想做的事情就像 -
unsigned char *ptr_data = "The size of this value is unknown";
System::IntPtr ptr = (System::IntPtr)ptr_data;
System::String^ str_data = Marshal::PtrToStringAuto(ptr);
array<Byte>^ bytes = System::Text::Encoding::->GetBytes(str_data);