gpt4 book ai didi

c# - C# 中的 List 相当于什么

转载 作者:行者123 更新时间:2023-11-30 15:24:25 25 4
gpt4 key购买 nike

如果我有一个 C# 方法,它接受一个 List 作为参数,例如这样

private bool ReadResponse(HidDevice device, List<byte> response, int length){
//do something
}

我需要将其重新写入 C 中。使用 unsigned char *pointer 作为参数是否是正确的方法?这是我现在拥有的当前 C 函数签名。调用该函数时,我将传入 unsigned char data[64] 作为第一个参数。

bool ReadReport(unsigned char *response, int length){
// do something
}

最终用途是我需要稍后将所有读取的字节存储到字符串中。

最佳答案

如果您的函数签名为

bool ReadReport(unsigned char *response, int length)

你需要这样调用它

ReadReport(data, len);
^
| //it expects unsigned char *, not unsigned char

关于c# - C# 中的 List<byte> 相当于什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28412237/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com