Comma operator should be used carefully
In C and C++, comma is the last operator in precedence table. So comma should be carefully used on right side of an assignment expression. For example, one might expect the output as b = 10 in below program. But program prints b = 20 as assignment has higher precedence over comma and the statement “b = 20, a” becomes equivalent to “(b = 20), a”.
Putting a bracket with comma makes b = a (or 10).
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.