Código
#include <stdio.h> main() { FILE *fin *fout; char c, x; if (((fin=fopen("DATOSIN.txt","rt"))==NULL || ((fout=fopen("DATOSOUT.txt", "wt"))==NULL)) {if if (fout ! = NULL) fclose (fout) ; if (fin ! = NULL) fclose (fin) ; printf ("Error en la apertura de ficheros de salida \n" ); return 1; } c = fgetc(fin); while (c != EOF) { x = fputc (c, fout); if (x! = c) printf ("Error de escritura"); c = fgetc(fin); } fclose (fin); fclose (fout); return 0; }