/*从字符串S中删除字符c*/ voidsqueeze(char[],char);intmain()include<stdio.h> gets(s);printf("输入需要删除的指定字符ch:");ch=getchar();for(i=j=0;s[i]!='\0';i++)if(s[i]!=ch)s[j++]=s[i];s[j]='\0';printf("删除字符 c 之后字符串为:s\n",ch,s);} 字符...
char* remove_chars(char *str,const char *rmchars)//删除str中所有包含在rmchars中的字符 { char buff[256]={0};char *ps1,*ps2;ps1=(char *)rmchars;while(*ps1)buff[*ps1++]=1;//遍历rmchars,将要删除的字符对应在buff中的位置1 ps2=str;while(*ps2)//遍历str,将要删除的字符置为...
include <stdio.h> char *del_chr(char * const str,const char todel) //从str字符串删除所有的todel字符,返回处理后的字符串地址 { int i,j;for (i = 0; str[i];) { if (str[i]==todel) { for (j=i; str[j]; j++) { str[j]=str[j+1];} } else i++;} return ...