Adding the libft
This commit is contained in:
parent
1b98b537b7
commit
c947e43e51
62 changed files with 2098 additions and 19 deletions
26
libft/list/ft_lstsize.c
Normal file
26
libft/list/ft_lstsize.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_lstsize.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/11/12 11:44:24 by rparodi #+# #+# */
|
||||
/* Updated: 2023/11/13 12:22:02 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
int ft_lstsize(t_list *lst)
|
||||
{
|
||||
int count;
|
||||
|
||||
count = 0;
|
||||
while (lst != NULL)
|
||||
{
|
||||
lst = lst->next;
|
||||
count++;
|
||||
}
|
||||
return (count);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue