-
Notifications
You must be signed in to change notification settings - Fork 1
/
ft_print_list.c
41 lines (38 loc) · 1.36 KB
/
ft_print_list.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_list.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: oadhesiv <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/06/01 16:49:56 by oadhesiv #+# #+# */
/* Updated: 2019/06/01 17:02:52 by oadhesiv ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_print_list(t_list *root)
{
size_t i;
if (!root)
{
ft_putstr("Trying to print void list!\n");
return ;
}
i = 0;
ft_putstr(">> List with root on ");
ft_print_ptr((void *)root);
ft_putchar('\n');
while (root)
{
ft_putstr("> ");
ft_putnbr(i);
ft_putstr(" [");
ft_print_ptr((void *)root);
ft_putstr("] -> [");
ft_print_ptr((void *)root->next);
ft_putstr("]\n");
ft_print_memory(root->content, root->content_size);
i++;
root = root->next;
}
}