In the C and C++ programming languages, the comma operator (represented by the token ,) is a binary operator that evaluates its first operand and discards the result, and then evaluates the second operand and returns this value (and type); there is a sequence point between these evaluations. The use of the comma token as an is distinct from its use in function calls and definitions, variable declarations, enum declarations, and similar constructs, where it acts as a . The comma operator has been deprecated in subscripting expressions (as of C++20); to make for better use of that syntax, for use as is available in other languages. Syntax The comma operator separates expressions (which have value) in a way analogous to how the semicolon terminates statements, and sequences of expressions are enclosed in parentheses analogously to how sequences of statements are enclosed in braces: (a, b, c) is a sequence of expressions, separated by commas, which evaluates to the last expression c, while {a; b; c;} is a sequence of statements, and does not evaluate to any value. A comma can only occur between two expressions – commas separate expressions – unlike the semicolon, which occurs at the end of a (non-block) statement – semicolons terminate statements. The comma operator has the lowest precedence of any C operator, and acts as a sequence point. In a combination of commas and semicolons, semicolons have lower precedence than commas, as semicolons separate statements but commas occur within statements, which accords with their use as ordinary punctuation: a, b; c, d is grouped as (a, b); (c, d) because these are two separate statements. Examples In this example, the differing behavior between the second and third lines is due to the comma operator having lower precedence than assignment. The last example differs as well since the return expression must be fully evaluated before the function can return. /** * Commas act as separators in this line, not as an operator. * Results: a=1, b=2, c=3, i=0 */ int a=1, b=2, c=3, i=0; /** * Assigns value of b into i. * Commas act as separators in the first line and as an operator in the second line. * Results: a=1, b=2, c=3, i=2 */ int a=1, b=2, c=3; int i = (a, b); /** * Assigns value of a into i. * Equivalent to: int i = a; int b; * Commas act