Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 18, 2020 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/074cdf0e2e7aeb6be178e2001862d9c0 to your computer and use it in GitHub Desktop.
Save parzibyte/074cdf0e2e7aeb6be178e2001862d9c0 to your computer and use it in GitHub Desktop.
void escribirListaEnArchivo() {
FILE *archivoSalida;
archivoSalida = fopen(nombreArchivoSalida, "w");
if (archivoSalida == NULL) {
printf("El archivo %s no existe", nombreArchivoSalida);
return;
}
// Recorrer la lista...
struct nodo *temporal = superior;
while (temporal != NULL) {
char miCadena[MAXIMA_LONGITUD_LINEA] = "";
// Arreglar el teclado descompuesto
arreglarTexto(temporal->linea, miCadena);
// Y escribir en el otro archivo
printf("Escribiendo la cadena %s\n", miCadena);
fprintf(archivoSalida, "%s\n", miCadena);
// Avanzamos en la lista
temporal = temporal->siguiente;
}
fclose(archivoSalida);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment