作者:佚名 | 来源:网络 | 添加时间:2006-02-23 15:08:13 | 人气:1149
#include <stdio.h>
#include <string.h>
#include <assert.h>
char *strDelete(char *s, char *t)
{
assert((s != NULL) && (t !=NULL));
char *p;
int index = strlen(t);
while(1)
{
p = strstr(s, t);
if (p == NULL)
break;
*p = ;
strcat(s, p+index);
}
return s;
}
int main()
{
char p[] = "how are you how are you";
char *p1 = NULL;
char *ptr = strDelete(p, p1);
printf("%s
", ptr);
return 0;
}
|