we can proceed to creating our own replacement for the standard strcpy() that comes
with C. It might look like:
char *my_strcpy(char *destination, char *source)
{
char *p = destination;
while (*source != '\0')
{
*p++ = *source++;
}
*p = '\0';
return destination;
}
In this case, I have followed the practice used in the standard routine of returning a
pointer to the destination.
Again, the function is designed to accept the values of two character pointers, i.e.
addresses, and thus in the previous program we could write:
int main(void)
{
my_strcpy(strB, strA);
puts(strB);
}