Re: Dave's Musical Motivator
by Hugo van der Sanden at 13:40 12/05/04 (Blogs::Dave)

Fear of dying ++. Discuss.

In general, pre-increment can be implemented something like this:

  increment through pointer
  return value pointed to

while post-increment looks something more like:

  read value through pointer
  store it in temporary variable
  increment through pointer
  return value of temporary variable

It is clear that post-increment cannot normally be achieved as efficiently as pre-increment, and therefore it is wise to use pre-increment wherever possible - and always if you're not going to use the return value.

I'd therefore recommend writing ++ Fear of dying.

Hugo

<< Slow Neutrino anyone ? Can you guys see >>
Powered by
Powered by Novacaster