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

前端 未结 7 2209
长情又很酷
长情又很酷 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:14

    The difference is in the operators you use ++c and c++

    c++ will increment the value BEFORE it is used in the calculation ++c will increment the value AFTER it is used in the calculation

    also cdhowie's answer explains it better

提交回复
热议问题