我从编组uint8_t得到数组中的内容0。我无法忘记错误。
C ++:
typedef struct {
uint8_t tst[64];
} Info_t;
C#:
public struct Info_t
{
public byte[] tst;
public Info_t(bool initializeByteArrays)
{
tst=new byte[64];
}
}
[DllImport(@"D.dll", EntryPoint = "connect", ExactSpelling = false)]
public static extern ushort connect(Info_t test);
Info_t dd = new MainForm.Info_t(true);
ushort res = connect(dd);
输出:
dd.tst [0] = 0 ... dd.tst [63] = 0