-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfree.c
53 lines (46 loc) · 1.32 KB
/
free.c
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* free.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mcatal-d <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/30 12:59:04 by mcatal-d #+# #+# */
/* Updated: 2022/12/30 18:00:15 by mcatal-d ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
#include <stdio.h>
int ft_tablen(int **tab)
{
int i;
i = 0;
while (*tab[i])
{
printf("%d\n", i);
i++;
}
return (i);
}
void *ft_free_all_tab(int **tab, int elts)
{
int i;
i = 0;
(void)(elts);
while (i < elts)
{
free(tab[i]);
i++;
}
return (NULL);
}
void free_list(t_list *debut_a)
{
t_list *temp_debut_a;
while (debut_a != NULL)
{
temp_debut_a = debut_a;
debut_a = debut_a->next;
free(temp_debut_a);
}
}