M
Money
I am doing things the right way or does it needs modification?
#include <stdio.h>
#define MS_DOS_EOF 26
#define MS_DOS_CR 13
int main(int argc, char *argv[])
{
int ch;
FILE *in, *out;
in = fopen(argv[1],"rb");
out = fopen(argv[2],"wb");
while (1)
{
ch = fgetc(in);
switch(ch)
{
case EOF:
case MS_DOS_EOF:
fclose(in);
fclose(out);
exit(0);
case MS_DOS_CR:
break;
default:
fputc(ch, out);
break;
}
}
return 0;
}
#include <stdio.h>
#define MS_DOS_EOF 26
#define MS_DOS_CR 13
int main(int argc, char *argv[])
{
int ch;
FILE *in, *out;
in = fopen(argv[1],"rb");
out = fopen(argv[2],"wb");
while (1)
{
ch = fgetc(in);
switch(ch)
{
case EOF:
case MS_DOS_EOF:
fclose(in);
fclose(out);
exit(0);
case MS_DOS_CR:
break;
default:
fputc(ch, out);
break;
}
}
return 0;
}