在字符串指针中找到与制定字符相同的字符并将其从字符串中删除

  void delcharfun(char *str,char ch){
int i=0,j=0;
while (*(str+i)){
	if(*(str+i)==ch){
		j=i;
		while(*(str+j)){
			*(str+j)=*(str+j+1);
			j++;
		}
	}
	else i++;
}

}

posted @ 2020-12-04 16:48  Auterman  阅读(151)  评论(0编辑  收藏  举报