#include <stdio.h>
void join(char *str1,char *str2)
{
char *p1,*p2,*p3;
int len1,m=0;
len1=0;
p1=str1;
p3=str1;
while(*p1!='\0')
{
len1++;
p1++;
}
p2=str2;
while(p1>=p3)
{
m++;
*(p1+len1-m)=*p1;
p1--;
}
while(*p1!='\0')
{
p1++;
*p1=*p2;
p1++;
}
}
int main(){
char s1[100]="ABCD";
char s2[100]="*";
join(s1,s2);
printf("%s\n",s1);
return 0;
}
运行结果BCD
我想要达到的结果ABC*D
请问上述程序中哪里错误导致结果错误?