-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstiter_bonus.c
28 lines (26 loc) · 1.13 KB
/
ft_lstiter_bonus.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstiter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: estettle <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/08 10:15:47 by estettle #+# #+# */
/* Updated: 2024/10/08 10:15:47 by estettle ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/* ft_lstiter()
* iterates through a list, applying the function f() to the content of each
* item throughout
*/
void ft_lstiter(t_list *lst, void (*f)(void *))
{
if (!lst)
return ;
while (lst)
{
f(lst->content);
lst = lst->next;
}
}