3 ms·
Well, the situation is even trickier: (a, b) = (10, 20) is allowed code in C++ (not in C). The result is that 20 is assigned to b, and a is untouched. Con
by amelius 6y ago
Well, the situation is even trickier:
(a, b) = (10, 20)
is allowed code in C++ (not in C). The result is that 20 is assigned to b, and a is untouched.
Contrast this to:
a, b = 10, 20
where (as above) 10 is assigned to b and a is left untouched, because it is parsed as:
a, (b = 10), 20
and I hope you agree that the behavior is very confusing.