change fonctions pour list avec nouvelles fonctions pour listes a deux sens
This commit is contained in:
24
srcs/ft_lstpush_front.c
Normal file
24
srcs/ft_lstpush_front.c
Normal file
@@ -0,0 +1,24 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_lstpush_front.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: simplonco <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/03/24 14:25:25 by simplonco #+# #+# */
|
||||
/* Updated: 2022/03/24 14:32:14 by simplonco ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
/*
|
||||
* add an element to the begining of a two-way list
|
||||
*/
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
void ft_lstpush_front(t_list **alst, t_list *new)
|
||||
{
|
||||
new->next = *alst;
|
||||
(*alst)->prev = new;
|
||||
*alst = new;
|
||||
}
|
||||
Reference in New Issue
Block a user