Our website would like to use cookies to store information on your computer. You may delete and block all cookies from this site, but parts of the site will not work as a result. Find out more about how we use cookies.

Login or Register

Powered by
Powered by Novacaster
 
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 >>
View Comments (Flat Mode) Printer Version
Dave's Musical Motivator David Crowson - 9/05
    Re: Dave's Musical Motivator Simon - 9/05
       Re: Dave's Musical Motivator David Crowson - 9/05
    Re: Dave's Musical Motivator Nic Jackson - 10/05
    Re: Dave's Musical Motivator Bruce Ure - 12/05
       Re: Dave's Musical Motivator David Crowson - 12/05
          Re: Dave's Musical Motivator David Crowson - 12/05
             Re: Dave's Musical Motivator Bruce Ure - 12/05
                Re: Dave's Musical Motivator David Crowson - 12/05
       Re: Dave's Musical Motivator Hugo van der Sanden - 12/05
          Re: Dave's Musical Motivator Bruce Ure - 12/05