gpt4 book ai didi

C 奇怪的 if 语句语法

转载 作者:行者123 更新时间:2023-11-30 18:24:32 25 4
gpt4 key购买 nike

我看到了这个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)->dataPointernewOb >.

然后将其结果与 0 进行比较,因为它位于 if() 之间。

关于C 奇怪的 if 语句语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40372496/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com