Re:List Processing in C
by vog on Tuesday December 21, 2010 @06:41AM
(#2027539)
Why don't you simply replace
with
[ Parent
| on HN ]
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.
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.