30 lines
1.1 KiB
C
30 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_list_at.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2016/11/09 15:31:04 by gtertysh #+# #+# */
|
|
/* Updated: 2016/11/09 16:27:44 by gtertysh ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "ft_list.h"
|
|
#include <stdlib.h>
|
|
|
|
t_list *ft_list_at(t_list *begin_list, unsigned int nbr)
|
|
{
|
|
unsigned int i;
|
|
t_list *temp;
|
|
|
|
i = 0;
|
|
temp = begin_list;
|
|
while (i < nbr && begin_list != NULL)
|
|
{
|
|
temp = begin_list->next;
|
|
begin_list = temp;
|
|
i++;
|
|
}
|
|
return (temp);
|
|
}
|