大家看看那里错了,不用指针就对,用了就错了
#include<stdio.h>char* stingcat(char s1[],char s2[]){
int length=0;
char *s=NULL;
char *c=s1;
for(;*c!='\0';++c,length++);
c=s2;
for(;*c!='\0';++c,length++); c = new char[length];
s=s1;
int i=0;
while(*s!='\0')
{
c[i++]=*s;
++s;
}
s=s2;
while(*s!='\0')
{
c[i++]=*s;
++s;
} c[i]='\0';
return c;}int main()
{
printf("%s",stingcat("abc","defg"));
}