Order of function call

后端 未结 6 1648
执念已碎
执念已碎 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:37

    Parenthesis in C/C++ force order of operations. func1() * func2() will be added to func3(), but the compiler can choose to call the functions in whatever order it wishes before passing in the results to the multiplication / addition operation.

提交回复
热议问题