6.5.17 Comma operator

Previous Table of Contents

1303

expression:
                assignment-expression
                expression , assignment-expression

1304 The left operand of a comma operator is evaluated as a void expression;

1305 there is a sequence point after its evaluation.

1306 Then the right operand is evaluated;

1307 the result has its type and value.95)

1308 If an attempt is made to modify the result of a comma operator or to access it after the next sequence point, the behavior is undefined.

1309 EXAMPLE

As indicated by the syntax, the comma operator (as described in this subclause) cannot appear in contexts where a comma is used to separate items in a list (such as arguments to functions or lists of initializers). On the other hand, it can be used within a parenthesized expression or within the second expression of a conditional operator in such contexts. In the function call


        f(a, (t=3, t+2), c)

the function has three arguments, the second of which has the value 5.

1310 95) A comma operator does not yield an lvalue.

1311 Forward references: initialization (6.7.8).

Next

Created at: 2005-06-29 02:19:00 The text from WG14/N1124 is copyright © ISO