-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstadd_back.c
More file actions
36 lines (32 loc) · 1.32 KB
/
ft_lstadd_back.c
File metadata and controls
36 lines (32 loc) · 1.32 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstadd_back.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ccarnot <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/05/15 08:41:05 by ccarnot #+# #+# */
/* Updated: 2023/05/15 12:15:41 by ccarnot ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*******************************************
* Function: ft_lstadd_back
* Description: Adds the node ’new’ at the end of the list.
* Memory allocations: None
* Crash values: None
* Return value: None
*******************************************/
void ft_lstadd_back(t_list **lst, t_list *new)
{
t_list *ptr;
if (*lst == 0x0)
*lst = new;
else
{
ptr = *lst;
while (ptr->next)
ptr = ptr->next;
ptr->next = new;
}
}