-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_pop_top.c
More file actions
24 lines (22 loc) · 795 Bytes
/
Copy pathft_pop_top.c
File metadata and controls
24 lines (22 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_pop_top.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yelallam <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/02/17 13:26:55 by yelallam #+# #+# */
/* Updated: 2026/02/24 10:51:51 by yelallam ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
t_stack *ft_pop_top(t_stack **head)
{
t_stack *copy;
if (*head == NULL)
return (NULL);
copy = *head;
*head = (*head)->next;
copy -> next = NULL;
return (copy);
}