-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathft_lstsize.c
34 lines (30 loc) · 1.14 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
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstsize.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: apuchill <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/07 16:55:41 by apuchill #+# #+# */
/* Updated: 2020/02/19 14:04:27 by apuchill ### ########.fr */
/* */
/* ************************************************************************** */
/*
** LIBRARY: N/A
** SYNOPSIS: count elements of a list
**
** DESCRIPTION:
** Counts the number of elements in a list.
*/
#include "libft.h"
int ft_lstsize(t_list *lst)
{
int count;
count = 0;
while (lst)
{
lst = lst->next;
count++;
}
return (count);
}