Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created April 15, 2022 02: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/655d46022f216ddd35e5e5dcc5b43f95 to your computer and use it in GitHub Desktop.
Save parzibyte/655d46022f216ddd35e5e5dcc5b43f95 to your computer and use it in GitHub Desktop.
void agregarNodoALista(struct NodoDeLista **nodo, char *nombre)
{
struct NodoDeLista *nuevoNodo = malloc(sizeof(struct NodoDeLista));
strcpy(nuevoNodo->nombre, nombre);
nuevoNodo->siguiente = NULL;
if ((*nodo) == NULL)
{
*nodo = nuevoNodo;
}
else
{
agregarNodoALista(&(*nodo)->siguiente, nombre);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment