Order of function call

后端 未结 6 1646
执念已碎
执念已碎 2020-12-11 18:06

for the expression

(func1() * func2()) + func3()

will func1() * func2() be evaluated first as it has brackets or can the functions be calle

6条回答
  •  感情败类
    2020-12-11 18:57

    You can't make any assumptions about the order in which these functions will be called. It's perfectly valid for the compiler to call these functions in any order, assign the results to temporaries, and then use these temporary values to calculate the result of the expression.

提交回复
热议问题