Code:
while (*to++ = *from++);
expands to (by moving the post-increments out of the while statement into the body)
Code:
while (*to = *from)
{
++to;
++from;
}
and since (a = b) sets a to be equal to b, and gives a result of b, this is equivalent to
Code:
while (*from)
{
*to = *from;
++to;
++from;
}
which, if you want to make the three statements into one, can be done as;
Code:
while (*from)
{
*to++ = *from++;
}
and the braces can be removed .... to get
Code:
while (*from) *to++ = *from++;
Now, since "while (x)" is equivalent to "while (x != 0)", this is equivalent to your code.
So all you've done is show there is more than one way to solve this problem.