write a C function void str_copy_drop(const char * string1, char * string2, char ch)
which copies the string string1 to string2 but with all occurrences of the character
passed as parameter ch omitted.
HERE IS WHAT I HAVE TRIED: its funny but can you check it and write me a correct program..
#include
#include
void str_copy_drop(const char *string1, char *string2, char ch);
void str_copy_drop(const char *string1, char *string2, char ch)
{
char *s1[20],*s2[20];
FILE *input;
input =fopen("string.txt","r");
fscanf(input,"%s",&s1);
s2= strcpy(s2,s1);
printf("\ncopied string is %s\n",s2);
}
above programs is wrong...i need solution for question described above..
Many thanks!!
2006-12-08
04:32:48
·
4 answers
·
asked by
skyrider
2