Is there a sequence point between these assignments?

前端 未结 6 1726

Is there a sequence point between the two assignments in the following code:

f(f(x=1,1),x=2);
6条回答
  •  感情败类
    2021-02-13 10:16

    There are sequence points at the beginning of a function call and at it's end. However because the order of operations on function arguments is implementation defined you can't gaurantee that f(x=1,1) will be executed before x=2.

    Also note that the , in the function call case is not the comma operator that introduces a sequence point.

提交回复
热议问题