二进制表达式('double'和'double')objective-c问题的无效操作数
-(double)performOperationWith:(double *)operand1
And:(double *)operand2 {
double result = 0.0;
result = operand1 + operand2;
return result;
}
二进制表达式('double'和'double')objective-c问题的无效操作数
-(double)performOperationWith:(double *)operand1
And:(double *)operand2 {
double result = 0.0;
result = operand1 + operand2;
return result;
}
它们是指针,因此您应该取消引用它们:
result = *operand1 + *operand2;
或者更改函数参数:
-(double)performOperationWith:(double )operand1 And:(double )operand2 {...}
只需删除*
:
-(double)performOperationWith:(double)operand1 And:(double)operand2 {
double result = 0.0;
result = operand1 + operand2;
return result;
}