编组“ uint8_t”得到零内容

问题描述 投票:0回答:1

我从编组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

c#
1个回答
0
投票

这解决了我的问题;

© www.soinside.com 2019 - 2024. All rights reserved.