Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 2, 2019 19:02
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/014506ed4c4f7e0aa78793b8845e4246 to your computer and use it in GitHub Desktop.
Save parzibyte/014506ed4c4f7e0aa78793b8845e4246 to your computer and use it in GitHub Desktop.
void imprimir(void) {
// Un simple encabezado, no hay que confundirse
char guiones[] = "--------------------";
printf("+%s+%s+\n", guiones, guiones);
printf("|%-20s|%-20s|\n", "PALABRA", "FRECUENCIA");
printf("+%s+%s+\n", guiones, guiones);
// A partir de aquí el código sí importa; simplemente recorremos la pila
struct nodo *temporal = superior;
while (temporal != NULL) {
printf("|%-20s|%-20d|\n", temporal->detalleDePalabra.palabra,
temporal->detalleDePalabra.frecuencia);
temporal = temporal->siguiente;
}
// El pie
printf("+%s+%s+\n", guiones, guiones);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment