-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstiter.c
31 lines (27 loc) · 1.24 KB
/
ft_lstiter.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
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstiter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maximegdfr <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/19 12:26:39 by mgodefro #+# #+# */
/* Updated: 2024/12/24 19:02:55 by maximegdfr ### ########.fr */
/* */
/* ************************************************************************** */
/* 🇬🇧 Iterates through each element of a linked list and applies a function
to its content.*/
/* 🇫🇷 Itère à travers chaque élément d'une liste chaînée et applique une
fonction à son contenu.*/
#include "libft.h"
void ft_lstiter(t_list *lst, void (*f)(void *))
{
if (lst && f)
{
while (lst)
{
f(lst->content);
lst = lst->next;
}
}
}