1.
char *strcpy(char * dest ,const char * src)
{
assert (dest != NULL && src != NULL);
while(*dest++ = *src++);
return dest;
}
2.
char *mystrcpy(char * dest ,const char * src)
{
char * p = dest;
int delta = dest - src;
assert (dest != NULL && src != NULL);
while(* (char *)(src+delta) = * src++);
return p;
}
3.
char *mystrcpy3(char * dest ,const char * src)
{
int * s;
int * d;
char * p = dest;
d = (int *)dest;
s = (int *)src;
while(1)
{
if(!CONTAIN_OF_ZERO_BYTE(*s))
{
*d = *s;
s++;
d++;
continue;
}
dest = (char *)d;
src = (char *)s;
while(*dest++ = *src++);
break;
}
return p;
}