mirror of
https://github.com/Ladebeze66/libft.git
synced 2025-12-13 04:36:55 +01:00
29 lines
1.0 KiB
C
Executable File
29 lines
1.0 KiB
C
Executable File
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_lstsize.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/02/23 17:17:36 by fgras-ca #+# #+# */
|
|
/* Updated: 2023/11/14 17:06:24 by fgras-ca ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
int ft_lstsize(t_list *lst)
|
|
{
|
|
int i;
|
|
t_list *tmp;
|
|
|
|
tmp = lst;
|
|
i = 0;
|
|
while (tmp)
|
|
{
|
|
tmp = tmp->next;
|
|
i++;
|
|
}
|
|
return (i);
|
|
}
|