//为了实现链式操作,将目的地址返回
char * strcpy( char *strDest, const char *strSrc ) // strSrc is input parameter and should not be changed
{
assert( (strDest != NULL) && (strSrc != NULL) );// assert parameter
char *address = strDest;
while( (*strDest++ = * strSrc++) != ‘\0’ );
return address;
}
int strlen( const char *str ) //输入参数const
{
assert( strt != NULL ); //断言字符串地址非0
int len;
while( (*str++) != '\0' )
{
len++;
}
return len;
}
char * strcpy( char *strDest, const char *strSrc ) // strSrc is input parameter and should not be changed
{
assert( (strDest != NULL) && (strSrc != NULL) );// assert parameter
char *address = strDest;
while( (*strDest++ = * strSrc++) != ‘\0’ );
return address;
}
int strlen( const char *str ) //输入参数const
{
assert( strt != NULL ); //断言字符串地址非0
int len;
while( (*str++) != '\0' )
{
len++;
}
return len;
}