#include <stdio.h>
int main (int argc, char *argv[])
{
FILE *ifp, *ofp;
char c;
if(argc!=4)
{
printf("\nGunakan format: ./rf [input_file] [output_file] [karakter_yang_mau_dihapus]\n");
return 0;
}
ifp = fopen(argv[1], "r");
ofp = fopen(argv[2], "w");
while ((c=fgetc(ifp))!=EOF)
{
if(c!=*argv[3])
{
fprintf(ofp,"%c",c);
}
}
fclose(ifp); fclose(ofp);
return 1;
}
int main (int argc, char *argv[])
{
FILE *ifp, *ofp;
char c;
if(argc!=4)
{
printf("\nGunakan format: ./rf [input_file] [output_file] [karakter_yang_mau_dihapus]\n");
return 0;
}
ifp = fopen(argv[1], "r");
ofp = fopen(argv[2], "w");
while ((c=fgetc(ifp))!=EOF)
{
if(c!=*argv[3])
{
fprintf(ofp,"%c",c);
}
}
fclose(ifp); fclose(ofp);
return 1;
}