|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
error: invalid types 'float' [4][3][3][float]' for array subscript
- float propensity_granularity(float a, float b, float c)
- {
- float table[4][3][3] =
- {
- {{0.0,0.0,0.0}, {0.0,0.0,0.1}, {0.1,0.1,0.2}},
- {{0.1,0.1,0.2}, {0.2,0.3,0.4}, {0.4,0.5,0.6}},
- {{0.4,0.5,0.6}, {0.5,0.6,0.7}, {0.8,0.9,1.0}},
- {{0.9,0.9,1.0}, {1.0,1.0,1.0}, {1.0,1.0,1.0}}
- };
- return table[a][b][c];
- }
复制代码
float propensity_granularity(int a, int b, int c)
{
float table[4][3][3] =
{
{{0.0,0.0,0.0}, {0.0,0.0,0.1}, {0.1,0.1,0.2}},
{{0.1,0.1,0.2}, {0.2,0.3,0.4}, {0.4,0.5,0.6}},
{{0.4,0.5,0.6}, {0.5,0.6,0.7}, {0.8,0.9,1.0}},
{{0.9,0.9,1.0}, {1.0,1.0,1.0}, {1.0,1.0,1.0}}
};
return table[a][b][c];
}
int main()
{
float aa = propensity_granularity(2, 2, 1);
printf("%f", aa);
}
|
|