[/QUOTE][/QUOTE]
More precisely: yes, unless the types of x, y, and z are such that
the answer is "no".
For instance, consider:
unsigned char x;
unsigned short y;
unsigned long z;
x = y = z = ULONG_MAX;
The effect here is to set z to ULONG_MAX, then assign ULONG_MAX to
y so that it is set to USHRT_MAX, then assign USHRT_MAX to x so
that it is set to UCHAR_MAX (assuming UCHAR_MAX <= USHRT_MAX and
USHRT_MAX <= ULONG_MAX, which I am not sure is entirely required
but is reasonably assume-able).
Note that if we change the names on the declarations or (easier
in this case) the order of the assignments, the result changes:
z = y = x = ULONG_MAX;
The effect here is to set x to UCHAR_MAX, then set y to the value
stored in x, then set z to the value stored in y. If, as is usually
the case, UCHAR_MAX < USHRT_MAX, this sets all three to just
UCHAR_MAX. Only if the three MAXes are all equal does this result
in all three being set to ULONG_MAX (which is then the same as
UCHAR_MAX).
... The reason I drew a distinction between them is that the
"x = y = z = whatever" version suggests that "there is a value,
'whatever', which - at this point in the program - it is important
for x, y, and z to share", whereas the other version suggests that
each assignment is independent of the others. It's a very minor
point, but it may help in some small way to convey to the maintenance
programmer the intent of the original programmer.
I would add that, unless the types of x, y, and z are all the same,
it is often unwise to use the "multiple assignment" form. (If the
types *are* the same, there is no possibility that one of the
assignments modifies the value along the way. It also works if
the values are "obviously unmodified" -- for instance, if all the
variables are scalars and the value is a tiny integer. Hence, the
form with "x = y = z = 0" is OK even if x, y, and z are different
integral types, or one or more are floating-point. Still, the ice
is thin here: you skate on it at your own risk.)