Libft
42 Libft library documentation
Loading...
Searching...
No Matches
ft_lstsize.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_lstsize.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: raphalme <raphalme@student.42.fr> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2025/12/29 19:17:00 by raphalme #+# #+# */
9
/* Updated: 2026/04/14 10:45:22 by raphalme ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
13
#include "../includes/types.h"
14
21
int
ft_lstsize
(
t_list
*lst)
22
{
23
int
count;
24
25
count = 0;
26
while
(lst)
27
{
28
lst = lst->
next
;
29
count++;
30
}
31
return
(count);
32
}
ft_lstsize
int ft_lstsize(t_list *lst)
Counts the number of nodes in a linked list.
Definition
ft_lstsize.c:21
s_list
Definition
types.h:4
s_list::next
struct s_list * next
Definition
types.h:6
src
ft_lstsize.c
Generated by
1.9.8