Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
代码片段:
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 ++以数组作为成员初始化结构