/* fichero copiar.c */ #include #include void main() { int ch; char file1[13], file2[13]; FILE *f1, *f2; printf("Teclea el nombre de fichero original:"); scanf("%s", &file1); printf("\ny ahora el nombre de fichero de copia:\n"); scanf("%s", &file2); f1 = fopen(file1, "r"); f2 = fopen(file2, "w"); if(!f1) printf("Fichero %s no existe!!", file1); else while ((ch = getc(f1)) != EOF) putc(ch,f2); fclose(f1); fclose(f2); }