分类: C/C++
2014-12-03 11:26:51
char *strcpy(char *dest, const char * src)
{
int i;
char *tdest = dest;
i = 0;
while ( (dest[i] = src[i]) != 0 ) {
i++;
}
return tdest;
}
char *strcpy(char *dest, const char *src)
{
char *tdest = dest;
while ( (*dest = *src) != 0) {
dest++;
src++;
}
return tdest;
}
char *strcpy(char *dest, const char *src)
{
char *tdest = dest;
while ( (*dest++ = *src++) != 0)
;
return tdest;
}
char *strcpy(char *dest, const char *src)
{
char *tdest = dest;
while ( *dest++ = *src++ )
;
return tdest;
}