-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack_clear.c
More file actions
28 lines (25 loc) · 1.07 KB
/
stack_clear.c
File metadata and controls
28 lines (25 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* stack_clear.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: algungor <algungor@student.42istanbul.com.t+#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/04/27 13:45:17 by algungor #+# #+# */
/* Updated: 2026/05/03 14:30:11 by algungor ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void stack_clear(t_stack **stack)
{
t_stack *tmp;
if (!stack || !*stack)
return ;
while (*stack)
{
tmp = (*stack)->next;
free(*stack);
*stack = tmp;
}
*stack = NULL;
}