diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-07-21 15:26:32 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-07-21 15:26:32 +0200 |
| commit | 23ad79e8b41c25bb4992d103d29a17612a52e351 (patch) | |
| tree | 9de3cde07cc38e59f08885171e9f99eeab8ab71b /c12/ex09 | |
| parent | 8b6e91bdb56bc01a588718472546f2a88e750b48 (diff) | |
| download | piscine-23ad79e8b41c25bb4992d103d29a17612a52e351.tar.gz piscine-23ad79e8b41c25bb4992d103d29a17612a52e351.tar.bz2 piscine-23ad79e8b41c25bb4992d103d29a17612a52e351.zip | |
c10 done, c11 on going, rush02 probably finished, bsq start
Diffstat (limited to 'c12/ex09')
| -rw-r--r-- | c12/ex09/ft_list.h | 4 | ||||
| -rw-r--r-- | c12/ex09/ft_list_foreach.c | 20 |
2 files changed, 21 insertions, 3 deletions
diff --git a/c12/ex09/ft_list.h b/c12/ex09/ft_list.h index 08a22a5..8f3a487 100644 --- a/c12/ex09/ft_list.h +++ b/c12/ex09/ft_list.h @@ -6,7 +6,7 @@ /* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/07/09 14:33:17 by cacharle #+# #+# */ -/* Updated: 2019/07/17 17:11:04 by cacharle ### ########.fr */ +/* Updated: 2019/07/19 08:27:40 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,6 +19,4 @@ typedef struct s_list void *data; } t_list; -t_list *ft_create_elem(void *data); - #endif diff --git a/c12/ex09/ft_list_foreach.c b/c12/ex09/ft_list_foreach.c index e69de29..2c9705f 100644 --- a/c12/ex09/ft_list_foreach.c +++ b/c12/ex09/ft_list_foreach.c @@ -0,0 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_list_foreach.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle <charles.cabergs@gmail.com> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/07/19 08:29:57 by cacharle #+# #+# */ +/* Updated: 2019/07/19 08:31:03 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +void ft_list_foreach(t_list *begin_list, void (*f)(void *)) +{ + while (begin_list != NULL) + { + (*f)(begin_list->data); + begin_list = begin_list->next; + } +} |
