After going through K & R, I saw the following code fragment strcopy function, which copies an array of characters to another.
If t is a pointer to the first array, and s is a pointer to the array to which t is copied, the code:
void strcopy(char *s, char *t){ while(*s++=*t++) ; }
I got confused in a while loop. I underestimate that inside the condition t is copied to s, but I don't understand which condition is being tested here. When will *t++ be false (or null)? Presumably when the character string ends. We can check if the line is complete by checking if the character pointed to by the character '\0' . K & R says the same. But then the book rather nonchalantly indicates that this test is not needed. So I wonder what is being tested here?
user485498
source share