-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstiter.c
42 lines (35 loc) · 1.38 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
32
33
34
35
36
37
38
39
40
41
42
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstiter.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tauer <tauer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/08 09:43:43 by tauer #+# #+# */
/* Updated: 2023/11/08 11:44:25 by tauer ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstiter(t_list *lst, void (*f)(void *))
{
while (lst)
{
f(lst->content);
lst = lst->next;
}
}
// void print_content(void *content)
// {
// printf("%s\n", (unsigned char *)content);
// }
// int main(void)
// {
// t_list *first = ft_lstnew("first one");
// t_list *second = ft_lstnew("second one");
// t_list *third = ft_lstnew("third one");
// first->next = second;
// second->next = third;
// third->next = NULL;
// ft_lstiter(first, print_content);
// return (0);
// }