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?
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.Originally Posted by studentc
When writing a specialization, be careful about its location; or to make it compile will be such a trial as to kindle its self-immolation.
so
you mean to say
if there is an expression
a=b=c;
does that mean the result of the expression is a
Yes.Originally Posted by studentc
When writing a specialization, be careful about its location; or to make it compile will be such a trial as to kindle its self-immolation.
Yes, but after a has been assigned the value of b, which in turn has been assigned the value of c.Originally Posted by studentc
so is
a first assigned the value of b,
or b first assigned the value of c
Operator Precedence and Associativity
Assignment has right-to-left associativity.
gg
[EDIT]
Ignore the C++ operators in that table
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));
My best code is written with the delete key.