Listen up here, I’ll make it quite clear I’m gonna put some boogie in your ear

  • 1 Post
  • 1 Comment
Joined 3 years ago
cake
Cake day: June 22nd, 2021

help-circle

  • Correct, but in theory ++ doesn’t have to increment anything. You can create operators on your own classes, so you could create a ++ operator that shoots the cat instead of incrementing a value. C++ is great (and terrible) like that. Therein lies another difference, if memory serves me correctly - one of prefix or postfix may create a possibly unnecessary object (I haven’t used C++ for several years now and so forget which one it is, and can’t be bothered to find out or work it out right now), so is more expensive in terms of memory usage and CPU time.

    There is (was?) a great book about C++ called C++ FAQs or something similar, by Marshall & Kline (I think) that goes into all this stuff and is a great read (it’s the most readable textbook I’ve ever come across).

    Caveat: my knowledge may well be out of date. The last time I picked up a C++ compiler in anger was around the turn of the century.