prev up next   top/contents search

comp.lang.c FAQ list · Question 3.7

Q: Why did

printf("%d %d", f1(), f2());
call f2 first? I thought the comma operator guaranteed left-to-right evaluation.

A: The comma operator does guarantee left-to-right evaluation, but the commas separating the arguments in a function call are not comma operators. [footnote] The order of evaluation of the arguments to a function call is unspecified. (See question 11.33.)

References: K&R1 Sec. 3.5 p. 59
K&R2 Sec. 3.5 p. 63
ISO Sec.
H&S Sec. 7.10 p. 224

prev up next   contents search
about this FAQ list   about eskimo   search   feedback   copyright

Hosted by Eskimo North