-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstsize.c
28 lines (25 loc) · 1.06 KB
/
ft_lstsize.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstsize.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mbartos <mbartos@student.42prague.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/26 10:33:17 by mbartos #+# #+# */
/* Updated: 2023/10/31 08:38:42 by mbartos ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_lstsize(t_list *lst)
{
size_t length;
if (lst == NULL)
return (0);
length = 0;
while (lst != NULL)
{
length++;
lst = lst->next;
}
return (length);
}