Why are we writing & ldquo; char * mystrcpy & rdquo; in this function? For what reason do we use the pointer?

advertisements
char* mystrcpy(char* dest, const char* src)
{
    int i; 

    for (i = 0; i < mystrlen2(src); i++) dest[i] = src[i];
    dest[i] = '\0';
    return dest;
}


Strings are implemented in C as arrays of characters and are accessed through a pointer to the first element in the array. The char*'s in this function are such pointers.