Why does a=(b++) have the same behavior as a=b++?

前端 未结 10 2067
借酒劲吻你
借酒劲吻你 2020-12-06 16:14

I am writing a small test app in C with GCC 4.8.4 pre-installed on my Ubuntu 14.04. And I got confused for the fact that the expression a=(b++); behaves in the

10条回答
  •  攒了一身酷
    2020-12-06 17:02

    To make it short: b++ is incremented after the statement is done

    But even after that, the result of b++ is put to a.

    Because of that parentheses do not change the value here.

提交回复
热议问题