ft_lstclear
Subject
FT_LSTCLEAR (simplified)
NAME
ft_lstclear -- removes the element passed as parameter and all the following elements
SYNOPSIS
void ft_lstclear(t_list **lst, void (*del)(void *));
DESCRIPTION
Deletes and free the memory of the element passed as parameter and all the following elements using 'del' and free(3). Finally, the initial pointer must be set to NULL.
PARAMETERS
lst: pointer address to one element
del: address of the function that can delete the element's content
RETURN VALUES
None
AUTHORIZED EXTERNAL FUNCTIONS
free(3)
Understandable explanation
This functions works similarly as the ft_lstdelone
function, but instead of removing only one element, it removes the element passed as parameter as well as all the following elements.
Commented solution
Last updated
Was this helpful?