tgrekov-fdf
HIVE fdf May 2024
Loading...
Searching...
No Matches
ft_lstsize_bonus.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_lstsize_bonus.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2023/10/28 01:19:42 by tgrekov #+# #+# */
9
/* Updated: 2023/11/06 11:44:57 by tgrekov ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
20
#include "
libft.h
"
21
28
int
ft_lstsize
(
t_list
*lst)
29
{
30
int
i;
31
32
i = 0;
33
while
(lst)
34
{
35
lst = lst->
next
;
36
i++;
37
}
38
return
(i);
39
}
ft_lstsize
int ft_lstsize(t_list *lst)
Counts the number of nodes in a list.
Definition
ft_lstsize_bonus.c:28
libft.h
s_list
Linked list node.
Definition
libft.h:44
s_list::next
struct s_list * next
Pointer to the next node.
Definition
libft.h:46
deps
libft
ft_lstsize_bonus.c