42_solong/libftx/libft/ft_lstsize.c
Camille Chauvet 9e58abcd5c kekw
2022-12-22 17:54:17 +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);
}