-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstiter_bonus.c
30 lines (27 loc) · 1.22 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
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstiter_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lclerc <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/21 11:34:40 by lclerc #+# #+# */
/* Updated: 2022/11/24 15:16:55 by lclerc ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
* ft_lstiter_bonus() iterates the list 'lst' and applies the function 'f' on
* content of each node.
*
* 'lst' is the address of a pointer to a node.
* 'f' is the address of the function used to iterate on the list.
*/
void ft_lstiter(t_list *lst, void (*f)(void *))
{
while (lst)
{
f(lst->content);
lst = lst->next;
}
}