News for hackers. Stuff that matters.
Re:C-- by gsg on Sunday October 27, 2013 @01:27PM (#6622625)
I just flicked through my copy of K&R (second edition), and at the beginning it clearly prefers preincrement. The introduction of for loops comes before that of ++, and the first for loop in the book is actually

    for (fahr = 0; fahr <= 300; fahr = fahr + 20)
        ...
Each for loop after the introduction of ++ uses preincrement (where applicable) for a while, and then the style shifts to postincrement.

EDIT: specifically, increments are deliberately prefix ("For the moment we will stick with the prefix form") until the full introduction of increment and decrement operators in section 2.8, after which they are postfix.

There are no comments on this comment yet.