-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_utils.c
More file actions
47 lines (42 loc) · 1.5 KB
/
Copy pathtest_utils.c
File metadata and controls
47 lines (42 loc) · 1.5 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* test_utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tbui-quo <tbui-quo@student.42wolfsburg.d> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/08/31 16:49:55 by tbui-quo #+# #+# */
/* Updated: 2023/08/31 16:55:39 by tbui-quo ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap.h"
void print_stack(t_stack *stack)
{
t_stack *current;
size_t index;
current = stack;
index = 0;
if (current == NULL)
ft_putstr_fd("current is null\n", STDOUT_FILENO);
while (current != NULL)
{
printf("Element[%zu] is %d\n", index, current->content);
current = current->next;
index++;
}
}
void print_index(t_stack *stack)
{
t_stack *current;
size_t index;
current = stack;
index = 0;
if (current == NULL)
ft_putstr_fd("current is null\n", STDOUT_FILENO);
while (current != NULL)
{
printf("Element[%zu] has index %d\n", index, current->index);
current = current->next;
index++;
}
}