#include <fcntl.h>
#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[2], "w");
if(b == NULL){
fprintf(stderr,"error");
return -1;
}
char c;
c = fgetc(a);
while (c != EOF){
if(c == '\n'){
fputc('\r',b);
}
fputc(c, b);
c = fgetc(a);
}
fcloseall();
return 0;
}
반응형