function parameter evaluation order

后端 未结 5 1890
攒了一身酷
攒了一身酷 2020-11-22 07:37

In C and C++, is there a fixed order for evaluation of parameter to the function? I mean, what do the standards say? Is it left-to-right or right-to-left<

5条回答
  •  失恋的感觉
    2020-11-22 07:46

    Keeping it safe: the standard leaves it up to the compiler to determine the order in which arguments are evaluated. So you shouldn't rely on a specific order being kept.

提交回复
热议问题