voidremove(char*str,char*substr){
intl=strlen(substr);
char*s=str;
inti;
while(*s)
{
if(memcmp(s,substr,l)==0)
{
memset(s,0,l);
s+=l;
}
else
{
s++;
}
}
i=s-str;
s=str;
while(i)
{
*s=*str;
if(*str!=0)s++;
str++;
i--;
}
*s=0;
}
intmain()
{
chara[]="adabcddabcdd";
charb[]="abc";
remove(a,b);
printf("%s",a);
getch();
return0;
}
評論