char *strcpy(char *strDest, const char *strSrc)
{
assert((strDest != NULL) && (strSrc != NULL));
char *address = strDest;
while( (*strDest++ = *strSrc++) != '\0' )
NULL;
return address;
}
为什么还要一个char*类型的返回值?
答:为了实现链式表达式,返回具体值。例如:
int length = strlen( strcpy( strDest, "hello world" ) );
{
assert((strDest != NULL) && (strSrc != NULL));
char *address = strDest;
while( (*strDest++ = *strSrc++) != '\0' )
NULL;
return address;
}
为什么还要一个char*类型的返回值?
答:为了实现链式表达式,返回具体值。例如:
int length = strlen( strcpy( strDest, "hello world" ) );