4 ms·
The use of the comma operator is interesting. Interesting? Meh. It's the difference between if (foo) { a = x; b = y; } and if (foo) a = x, b = y; So it
by pmjordan 17y ago
The use of the comma operator is interesting.
Interesting? Meh. It's the difference between
if (foo) { a = x; b = y; }
and
if (foo) a = x, b = y;
So it's purely used as a notational quirk.
For loops and similar situations are when the comma operator really comes in handy - although you really need to watch out for the rule of not assigning to the same variable more than once before a sequence point, especially as many compilers will only warn you about it at highest warning level - or not at all.