change fonctions pour list avec nouvelles fonctions pour listes a deux sens
This commit is contained in:
30
srcs/ft_lstlen.c
Normal file
30
srcs/ft_lstlen.c
Normal file
@@ -0,0 +1,30 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_lstlen.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: simplonco <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/03/24 16:20:25 by simplonco #+# #+# */
|
||||
/* Updated: 2022/03/24 16:22:24 by simplonco ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
/*
|
||||
* return the len of the two-way list
|
||||
*/
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
int ft_lstlen(t_list *lst)
|
||||
{
|
||||
int size;
|
||||
|
||||
size = 0;
|
||||
while (lst)
|
||||
{
|
||||
size++;
|
||||
lst = lst->next;
|
||||
}
|
||||
return (size);
|
||||
}
|
||||
Reference in New Issue
Block a user