-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstsize.c
More file actions
32 lines (28 loc) · 1.1 KB
/
Copy pathft_lstsize.c
File metadata and controls
32 lines (28 loc) · 1.1 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstsize.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: havyilma <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/16 17:37:57 by havyilma #+# #+# */
/* Updated: 2022/10/21 17:06:26 by havyilma ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <string.h>
int ft_lstsize(t_list *lst)
{
int count;
count = 0;
if (!lst)
return (0);
if (lst && !(lst->next))
return (1);
while (lst != NULL)
{
count++;
lst = lst->next;
}
return (count);
}