42_minitalk/libftx/libft/ft_lstsize.c
2023-01-23 13:22:30 +01:00

27 lines
1.0 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstsize.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/30 01:18:08 by cchauvet #+# #+# */
/* Updated: 2022/09/30 01:18:15 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_lstsize(t_list *lst)
{
int count;
count = 0;
while (lst != NULL)
{
count++;
lst = lst->next;
}
return (count);
}