从C ++到带单声道的字节数组C#的无符号char数组

时间:2019-07-17 18:28:09

标签: c++ mono embedding

如何在单声道帮助下将无符号char数组从c ++转换为字节数组c#?我尝试下一步,但是当我检查c#数组时,有不同的值不像我的。

byte b[] = {0x01,0x02};

MonoArray* new_byte_array = mono_array_new(Mono::currentDomain, mono_get_byte_class(), 2);
mono_array_setref(new_byte_array, 0,mono_value_box(Mono::currentDomain, mono_get_byte_class(),&b[0]));
mono_array_setref(new_byte_array, 1,mono_value_box(Mono::currentDomain, mono_get_byte_class(),&b[1]));

0 个答案:

没有答案