tgrekov-libft
HIVE libft Oct 2023
Loading...
Searching...
No Matches
ft_lstsize_bonus.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* ft_lstsize_bonus.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2023/10/28 01:19:42 by tgrekov #+# #+# */
9/* Updated: 2023/11/06 11:44:57 by tgrekov ### ########.fr */
10/* */
11/* ************************************************************************** */
12
20#include "libft.h"
21
29{
30 int i;
31
32 i = 0;
33 while (lst)
34 {
35 lst = lst->next;
36 i++;
37 }
38 return (i);
39}
int ft_lstsize(t_list *lst)
Counts the number of nodes in a list.
Linked list node.
Definition libft.h:44
struct s_list * next
Pointer to the next node.
Definition libft.h:46