Name: Anonymous 2007-05-11 16:50 ID:tCgeez6Q
I receive a string, and I want to remove any 'a', 'b' and 'c' characters, in a recursive way.
How do I do this in C and Java?
Thanks
How do I do this in C and Java?
Thanks
#include <stdio.h>
void remove_char_from_string(char *string,char char_to_remove){
int i,j=0,l=strlen(string);
char s2[l];
for(i=0;i<l;++i)if(!(string[i]==char_to_remove))s2[j++]=string[i];
s2[j]=0;
memcpy(string,s2,l);
}