-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstsize.c
30 lines (27 loc) · 1.07 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
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstsize.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ysaito <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/07/06 08:34:09 by ysaito #+# #+# */
/* Updated: 2021/11/01 20:45:29 by ysaito ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_lstsize(t_list *lst)
{
int numlist;
if (lst == NULL)
{
return (0);
}
numlist = 1;
while (lst->next != NULL)
{
lst = lst->next;
numlist++;
}
return (numlist);
}