feat: added more lst functionality
This commit is contained in:
parent
2708a86b5f
commit
0863951787
7 changed files with 100 additions and 0 deletions
12
srcs/lst/ft_lstget.c
Normal file
12
srcs/lst/ft_lstget.c
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include "libft.h"
|
||||
|
||||
t_list *ft_lstget(t_list *lst, int index)
|
||||
{
|
||||
int i = 0;
|
||||
while (lst && i < index)
|
||||
{
|
||||
lst = lst->next;
|
||||
i++;
|
||||
}
|
||||
return ((i == index) ? lst : NULL);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue