What does the comma operator , do

ccomma-operatoroperators

What does the , operator do in C?

Best Answer

The expression:

(expression1,  expression2)

First expression1 is evaluated, then expression2 is evaluated, and the value of expression2 is returned for the whole expression.