我编写了一个非常简单的代码来查找数组中的最大值。我无法弄清楚这里出了什么问题......
float maxValue(float **ArrayIn, long length, long width, short* result_coor){
int i,j;
float maxvalue = ArrayIn[0][0];
for(i=0;i<length;i++){
for(j=0;j<width;j++){
if((ArrayIn[i][j]>maxValue)==1){
maxValue = ArrayIn[i][j];
result_coor[0] = i;
result_coor[1] = j;
}
}
}
return maxvalue;
}
我收到此错误:
array_processing.c: In function ‘maxValue’:
array_processing.c:9:20: error: invalid operands to binary > (have ‘float’ and ‘float
(*)(float **, long int, long int, short int *)’)
array_processing.c:10:13: error: lvalue required as left operand of assignment
make: *** [array_processing.o] Error 1