I have been reading a tutorial dealing with functions and it shows the example code:
char *my_strcpy(char *destination, char *source)
{
char *p = destination;
while (*source != '\0')
{
*p++ = *source++;
}
*p = '\0';
return destination;
}
Although it shows no reason why it makes my_strcpy a pointer (char *my_strcyp(char *dest......)). What is the use of this, Is the astrik before my_strcyp just there since there are pointers in the parameters (char *destination, char *source) and one last thing....why do they say: char *p = destination, couldn't they just use destination instead of declaring another pointer that points to it?
Thanks a lot.