1. ## pointer equation

Hi
in the code
[code]
{while ( (*s++ = *t++) != '\0');}
[\code]

i was wondering if both *t and *s are checked for the null. or is it just *t?

2. Originally Posted by studentc
Hi
in the code
[code]
{while ( (*s++ = *t++) != '\0');}
[\code]

i was wondering if both *t and *s are checked for the null. or is it just *t?
Only the result of the expression is checked for the null character. The result of the expression is the value of *s. However, because the expression was assignment, it's a safe bet that *t and *s have the same value.

3. so
you mean to say
if there is an expression

a=b=c;

does that mean the result of the expression is a

4. Originally Posted by studentc
so
you mean to say
if there is an expression

a=b=c;

does that mean the result of the expression is a
Yes.

5. Originally Posted by studentc
so
you mean to say
if there is an expression

a=b=c;

does that mean the result of the expression is a
Yes, but after a has been assigned the value of b, which in turn has been assigned the value of c.

6. so is
a first assigned the value of b,
or b first assigned the value of c

7. Operator Precedence and Associativity

Assignment has right-to-left associativity.

gg

[EDIT]
Ignore the C++ operators in that table

8. b is assigned the value of c, then a is assigned the value of b. Assignment is performed right to left, so it would look like this if fully parenthesized:
Code:
`(a = (b = c));`