-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstsize_bonus.c
34 lines (30 loc) · 1.15 KB
/
ft_lstsize_bonus.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_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bnidia <bnidia@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/17 14:54:41 by bnidia #+# #+# */
/* Updated: 2021/10/29 02:36:07 by bnidia ### ########.fr */
/* */
/* ************************************************************************** */
/* ft_lstsize
** Counts the number of elements in a list
** Return Value
** Length of the list
*/
#include "libft.h"
int ft_lstsize(t_list *lst)
{
unsigned int i;
t_list *lst_temp;
i = 0;
lst_temp = lst;
while (lst_temp)
{
lst_temp = lst_temp->next;
i++;
}
return (i);
}