Created
August 2, 2019 22:18
-
-
Save parzibyte/ddaea5d032ce780be160bc710b56fff3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Operación push | |
void agregar(int numero) { | |
printf("Agregando %d\n", numero); | |
// El que se agregará; reservamos memoria | |
struct nodo *nuevoNodo = malloc(sizeof(struct nodo)); | |
// Le ponemos el dato | |
nuevoNodo->numero = numero; | |
// Y ahora el nuevo nodo es el superior, y su siguiente | |
// es el que antes era superior | |
nuevoNodo->siguiente = superior; | |
superior = nuevoNodo; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment