feat: added more lst functionality
This commit is contained in:
parent
2708a86b5f
commit
0863951787
7 changed files with 100 additions and 0 deletions
13
srcs/lst/ft_lstclear.c
Normal file
13
srcs/lst/ft_lstclear.c
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#include "libft.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
void ft_lstclear(t_list **lst)
|
||||
{
|
||||
t_list *tmp;
|
||||
while (lst && *lst)
|
||||
{
|
||||
tmp = (*lst)->next;
|
||||
free(*lst);
|
||||
*lst = tmp;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue