第1个回答 2016-01-07
char * diy_strcat(char *s1, const char *s2)
{
char * pStr = NULL;
if(NULL == s2 || NULL == s2)
return NULL;
pStr = s1;
while(*pStr++ != '\0') // move the pointer to the end of s1
;
pStr--;
while((*pStr++ = *s2++) != '\0') // copy the char to s1
;
return s1;
}本回答被网友采纳