gpt4 book ai didi

c - 在 C 中的 Struct 中初始化 const Array

转载 作者:太空狗 更新时间:2023-10-29 15:18:06 26 4
gpt4 key购买 nike

代码片段:

static struct
{
static const unsigned char myConstArray[] =
{
50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60,
};

//more....
}_SomeValues;

这怎么行? (提示 after = a ; 丢失了)

最佳答案

更改为:

static struct
{
const unsigned char myConstArray[14];

} _SomeValues =
{
{
50, 51, 52, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60,
}
};

关于c - 在 C 中的 Struct 中初始化 const Array,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13032851/

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