int main(int argc, char* argv[])
{
int ch;
char *file1 = "c://e1.txt";
char *file2 = "c://e.txt";
FILE *in = NULL;
FILE *out = NULL;
if (!(out = fopen(file1,"wb+")))
{
return 1;
}
if (!(in = fopen(file2,"rb+")))
{
return 1;
}
while ((ch = fgetc(in))!=EOF)
{
if(ch=='/n')
{
fputc('/r',out);
fputc('/n',out);
}
else
{
fputc(ch,out);
}
}
fclose(in);
fclose(out);
DeleteFile(file2);
rename(file1,file2);
return 0;
}