Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "../headers/ft_list.h"
- void ft_list_remove_if(t_list **begin_list, void *data_ref, int (*cmp)())
- {
- t_list *t;
- if (*begin_list)
- {
- if ((*cmp)((*begin_list)->data, data_ref) == 0)
- {
- t = (*begin_list);
- (*begin_list) = (*begin_list)->next;
- free(t);
- ft_list_remove_if(begin_list, data_ref, cmp);
- }
- else
- ft_list_remove_if(&((*begin_list)->next), data_ref, cmp);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement