简体   繁体   English

聚合初始化程序中的多余元素

[英]excess elements in aggregate initializer

static const double convTable[4][4] =
{
    {1.0,           1000.0,     1000000.0,  1000000000,0    },
    {0.001,         1.0,        1000.0,     1000000,0       },
    {0.000001,      0.001,      1.0,        1000.0          },
    {0.000000001,   0.000001,   0.001,      1,0             }
};

I have this array, in a header file, but it won't compile, Not sure why? 我在头文件中有此数组,但无法编译,不知道为什么吗?

You are using commas instead of points in some of the items, so you have more than 4 items per row. 您在某些项目中使用逗号而不是点,因此每行有四个以上项目。

{1.0, 1000.0, 1000000.0, 1000000000,0 }
                                   ^

should be 应该

{1.0, 1000.0, 1000000.0, 1000000000.0 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 数组初始化程序中的多余元素 - Excess elements in array initializer C++ 标量初始值设定项中的多余元素 - C++ Excess elements in scalar initializer 标量初始化程序代码中的多余元素使用gcc但不使用g ++进行编译 - Excess elements in scalar initializer code compiles with gcc but not g++ 数组初始化C ++ char Xcode中的多余元素 - Excess elements in array initializer C++ char Xcode '结构初始化程序中的多余元素'错误与C ++ 11统一初始化 - 'Excess elements in struct initializer' error with C++11 uniform initialization 嵌套std :: array时struct initializer中的多余元素 - Excess elements in struct initializer when nested std::array 使用igraph C库生成具有幂律度分布的网络时,“标量初始化器中的多余元素” - “excess elements in scalar initializer” when using igraph C library to generate a network with power law degree distribution 数组初始化器中多余元素的填充字节发现以及常见和特殊的编译器行为 - Padding bytes discovery & common and special compiler behavior on excess elements in array initializer 转发到聚合初始化器? - Forwarding to an Aggregate Initializer? 成员聚合初始化列表不受支持? - Member aggregate initializer list unsupported?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM