-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstsize.c
More file actions
34 lines (31 loc) · 1.15 KB
/
ft_lstsize.c
File metadata and controls
34 lines (31 loc) · 1.15 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
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstsize.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jowagner <jowagner@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/30 20:59:25 by jowagner #+# #+# */
/* Updated: 2024/12/12 19:49:23 by jowagner ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief Counts the number of nodes in a list.
*
* @param lst The beginning of the list.
* @return The length of the list.
*/
int ft_lstsize(t_list *lst)
{
int i;
t_list *tmp;
i = 0;
tmp = lst;
while (tmp)
{
tmp = tmp->next;
i++;
}
return (i);
}