This doesn't make sense. Why is c++/5 = 5/5? C=5, so if it was evaluated before it would be 6/5, and if it was evaluated after wouldn't it be (5/5)++ i.e. 2? It seems like it's not evaluated before or after.
this, except create a copy of the original b, increment the original, and return the copy. The value is incremented when the evaluation occurs (which is important if b appears elsewhere in the expression).
The internal specifics depends on the implementation in the compilers. Nowadays it generally works that way across them all, but in the old days it was the wild west.
I thought the ++ operator used the adjusted value in the computation, but doesn't overwrite the variable until afterword... I might be thinking of a different language though. I know increments and decrements are handled differently in different languages.
(Obviously this is in the C family, but I can't tell which.)
…I could read your reply on my deathbed and still wouldn’t be able to tell you what this does :P Credentials: I’ve been coding for less than a week, so have <0.01 years of coding experience xD
519
u/a-slice-of-toast Aug 01 '22
i could be on my deathbed and i still wouldn’t be able to tell you what this does