3 ms·
Almost every C and C++ book I've seen has an, imho, needless chapter on why "y = x++" and "y = ++x" are not the same thing. This does not reduce clutter.
by vvpan 11y ago
Almost every C and C++ book I've seen has an, imho, needless chapter on why "y = x++" and "y = ++x" are not the same thing. This does not reduce clutter.
- CamperBob2 11y agoPublic service announcement: If you can't keep this stuff straight, C++ may not be for you. Edit: I'm only half-joking. Removing postincrement and postdecrement from C++, as some people are suggesting, would be like removing the oil filler cap from a chain saw. The tool would still be dangerous to use, but now it's annoying to use as well.
- brianberns 11y agoYou might enjoy ++C, though.
- whoopdedo 11y agoI'm just perturbed by how many people are describing x++ as equivalent to x+=1
- fao_ 11y agoThat's the fault of the authors, not the fault of the language feature. And IMO I've not really found the difference confusing in practice.