while (*s++ = *t++);
From the priority table, you can clearly see that ++ has a higher priority than * . But ++ used here as the post increment operator, so the increment occurs after the assignment expression. So, first *s = *t , then s and t increase.
EDIT:
while(*(s++) = *(t++));
Same as above. You make it more explicit with parentheses. But remember that ++ is still a incremental increment.
while(++*s = ++*t);
There is only one statement next to s. So, * is applied first, and ++ is applied to this result, which leads to the lvalue required error.
while(*++s = *++t);
Again, just the operator next to s, t. Thus, an increment occurs first, and then a copy. Thus, we actually skip a copy of the first char from t to s.
codaddict
source share