我看到了这个if
声明,我不确定它到底是如何工作的,什么与什么进行比较?是否缺少&&
或||
? parent 让我很困惑。
if ((list->func)((list->head)->dataPointer, newOb) < 0) {
最佳答案
what is being compared with what? The parens are confusing me.
if(
和 )
之间部分的结果与 0 进行比较,就像每个 if 语句一样。
Is there a lack of && or ||?
我没有看到任何 && 或 ||
The parens are confusing me.
(list->func)((list->head)->dataPointer, newOb)
的作用是(不一定按此顺序):
- 评估
list->func
- 评估
(list->head)->dataPointer
- 调用
list->func
传递两个参数(list->head)->dataPointer
和newOb
>.
然后将其结果与 0 进行比较,因为它位于 if(
和 )
之间。
关于C 奇怪的 if 语句语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40372496/