mercredi 31 août 2016

C Standard - Comma Operator Syntax

according to the C Standard (and K&R) the syntax of the Comma-Operator is as follows:

expression:
    assignment-expression
    expression, assignment-expression

But why does this statement work?

5+5, 1+1; 

5+5 and 1+1 are not assignment-expressions, but the C Standard requires assignment-expressions as operands for the Comma-Operator.

Aucun commentaire:

Enregistrer un commentaire