File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed
Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ SRC += $(addprefix $(DIR), \
7979 ft_lstlast_d.c \
8080 ft_lstnew_back_d.c \
8181 ft_lstnew_d.c \
82+ ft_lstsize_d.c \
8283)
8384
8485# Singly-linked:
Original file line number Diff line number Diff line change 66/* By: ldulling <ldulling@student.42.fr> +#+ +:+ +#+ */
77/* +#+#+#+#+#+ +#+ */
88/* Created: 2023/09/24 16:17:46 by ldulling #+# #+# */
9- /* Updated: 2024/06/07 18:59:14 by ldulling ### ########.fr */
9+ /* Updated: 2024/06/28 19:31:02 by ldulling ### ########.fr */
1010/* */
1111/* ************************************************************************** */
1212
@@ -60,6 +60,7 @@ void ft_lstiter_d(t_list_d *lst, void (*f)(void *));
6060t_list_d * ft_lstlast_d (t_list_d * lst );
6161bool ft_lstnew_back_d (t_list_d * * lst , void * content );
6262t_list_d * ft_lstnew_d (void * content );
63+ int ft_lstsize_d (t_list_d * lst );
6364
6465\
6566/* Lists singly-linked */
Original file line number Diff line number Diff line change 1+ /* ************************************************************************** */
2+ /* */
3+ /* ::: :::::::: */
4+ /* ft_lstsize_d.c :+: :+: :+: */
5+ /* +:+ +:+ +:+ */
6+ /* By: ldulling <ldulling@student.42.fr> +#+ +:+ +#+ */
7+ /* +#+#+#+#+#+ +#+ */
8+ /* Created: 2023/09/24 16:08:06 by ldulling #+# #+# */
9+ /* Updated: 2024/06/28 19:30:32 by ldulling ### ########.fr */
10+ /* */
11+ /* ************************************************************************** */
12+
13+ #include "libft.h"
14+
15+ int ft_lstsize_d (t_list_d * lst )
16+ {
17+ int n ;
18+ t_list_d * cur ;
19+
20+ n = 0 ;
21+ cur = lst ;
22+ while (cur != NULL )
23+ {
24+ n ++ ;
25+ cur = cur -> next ;
26+ }
27+ return (n );
28+ }
You can’t perform that action at this time.
0 commit comments