News for hackers. Stuff that matters.
Re:List Processing in C by alexgartrell on Tuesday December 21, 2010 @12:57PM (#2028624)
I did initially, until I looked up [1] and changed it in the edit. I figure separating it is cleaner.

[1] http://en.wikipedia.org/wiki/Comma_operator

Re:List Processing in C by vog on Wednesday December 22, 2010 @09:22AM (#2031358)
But the combined expression solves exactly your problem!

You were not sure whether the increment would always happen before the assignment. In the combined expression you can simply use the pre-increment operator, which will always increment before the rest of the expression.

It's shorter, unambiguous and leaves less questions. How can something be any "cleaner" than that?

Also, the statements "array[index++]" and "array[++index]" are pretty well-understood idioms in C.