K
Kenneth Brody
Keith said:The FAQ doesn't directly address this. Question 3.2 discusses
i++ * ++i, but it doesn't explicitly mention modifying the same
variable twice in different arguments of the same function call.
Combine this with the common misconception that the commas separating
arguments are comma operators, and the confusion is understandable.
It would be good for question 3.2 to mention function arguments. On
the other hand, I see that <http://www.eskimo.com/~scs/C-faq/q3.2.html>
celebrated its tenth birthday two months ago (that's ten years since
the page has been modified).
Perhaps simply modifying 3.8 to include:
Note that, although the comma operator is a sequence point, the
comma used to separate function parameters is not the comma
operator, and therefore is not a sequence point.
Of course, to confuse things, one could combine the comma operator
with the comma separator:
printf("%d, %d, %d\n", i, (j++, j++), k);
Is this guaranteed to increment j twice, passing the singly-imcremented
value to printf?
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:[email protected]>