“C - C++” joke about postfix/prefix operation ordering

前端 未结 7 2161
长情又很酷
长情又很酷 2020-12-22 13:34

My friend sent me a joke:

Q. What\'s the difference between C and C++?

A. Nothing, because: (C - C++ == 0)

I tried to change

相关标签:
7条回答
  • 2020-12-22 14:26

    Because c++ - c becomes (c - c-incremented-by-one), which is -1 and ++c - c becomes (c-incremented-by-one - c-incremented-by-one) which is 0.

    0 讨论(0)
提交回复
热议问题