发布网友
共1个回答
热心网友
question4:
//Do not change the original value of the variable
char *strcat(char *s,char *t)
{
char *point = s;
int lengh = 0;
static char *tarStr = NULL;
lengh = length(s) + lengh(t) + 1;
tarStr = molloc(sizeof(char) * lengh);
while(1)
{
if(*point != '\0')
{
tarStr[i] = *point;
i++;
point++;
}
else
{
point = t;
}
if(i >= lengh)
break;
}
return tarStr;
}