I am reading The C Programming Language, and when it gets to Character Pointers and Functions (5.5) I get a problem.
In 5.5, the authors showed four versions of strcpy()
. My problem lies in the version 3:
/*strcpy: copy t to s; pointer version 3*/
void strcpy(char *s, char *t)
{
while (*s++ = *t++)
;
}
There is no comparison against '\0'. And how does the termination of the loop work under such a condition?