void arrayRound(int id, double baln)
{
baln[id] = (baln[id]*100) + 0.5;
int temp = (int) baln[id];
baln[id] = (double) temp;
baln[id] = baln[id] / 100;
}
函数体给我错误信息。该函数旨在将数组索引四舍五入到最接近的百分之一。我分别将索引变量和数组传递给函数。这是错误消息:
Fxns.c:70: error: subscripted value is neither array nor pointer
Fxns.c:70: error: subscripted value is neither array nor pointer
Fxns.c:71: error: subscripted value is neither array nor pointer
Fxns.c:72: error: subscripted value is neither array nor pointer
Fxns.c:73: error: subscripted value is neither array nor pointer
Fxns.c:73: error: subscripted value is neither array nor pointer
我的第一个猜测是我需要在参数字段中的 baln 之后包含空括号,但这没有帮助。有什么想法吗?
最佳答案
关于c - 这个数组错误是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9592148/