#include<stdio.h>
char * squeeze(char s1[], char s2[])
{
char s3[50];
int i,j,k;
k=0;
for(i=0;s1[i]!='\0';)
{
for(j=0;(s2[j]!='\0')&&(s1[i++]==s2[j++]);)
;
s3[k++]=s1[i];
}
s3[k]='\0';
printf("%s\n",s3);
return s3;
}
void main()
{
char* s1="abcd1234abce";
char * s2="abc";
squeeze(s1,s2);
//printf("%s\n",);
}
char * squeeze(char s1[], char s2[])
{
char s3[50];
int i,j,k;
k=0;
for(i=0;s1[i]!='\0';)
{
for(j=0;(s2[j]!='\0')&&(s1[i++]==s2[j++]);)
;
s3[k++]=s1[i];
}
s3[k]='\0';
printf("%s\n",s3);
return s3;
}
void main()
{
char* s1="abcd1234abce";
char * s2="abc";
squeeze(s1,s2);
//printf("%s\n",);
}
用vc 6.0编译出来 结果为 d1234ae 多出字符a?程序没有问题啊。怎么会出现这样的问题。求助