#include <stdio.h>
int main(int argc, char *argv[])
{
FILE *a = fopen(argv[1], "r");
if(a == NULL){
fprintf(stderr, "error");
return -1; }
FILE *b = fopen(argv[1], "w");
char c;
c = fgetc(a);
while(c != EOF){
if( c == '\r')
fputc('\n',b);
fputc(c,b);
c = fgetc(a);
}
fcloseall();
return 0;
}
반응형