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 후 빈 괄호를 포함하는 데 필요한, 그러나 그것은 도움이되지 않았다이었다. 어떤 아이디어?
인수 목록에'baln' 뒤에 빈괄호를 포함시켜야합니다. 그 시도를 보여줄 수 있습니까? – Ryan
함수 매개 변수를 보면 baln은 "배열이나 포인터가 아니며"대신 double으로 나열됩니다. 오타 또는 포인터를 잊어 버렸습니까? – tamarintech