33 lines
1.2 KiB
C
33 lines
1.2 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_lstsize.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/11/12 11:44:24 by rparodi #+# #+# */
|
|
/* Updated: 2025/09/01 16:39:28 by rparodi ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "list.h"
|
|
#include <unistd.h>
|
|
|
|
/**
|
|
* @brief Give the size of the chained list
|
|
*
|
|
* @param lst the chained list
|
|
* @return the size of the list
|
|
*/
|
|
int ft_lstsize(t_list *lst)
|
|
{
|
|
int count;
|
|
|
|
count = 0;
|
|
while (lst != NULL)
|
|
{
|
|
lst = lst->next;
|
|
count++;
|
|
}
|
|
return (count);
|
|
}
|