17 lines
268 B
C
17 lines
268 B
C
#include "libft.h"
|
|
|
|
void ft_lstreverse(t_list **lst)
|
|
{
|
|
t_list *prev = NULL;
|
|
t_list *curr = *lst;
|
|
t_list *next;
|
|
|
|
while (curr)
|
|
{
|
|
next = curr->next;
|
|
curr->next = prev;
|
|
prev = curr;
|
|
curr = next;
|
|
}
|
|
*lst = prev;
|
|
}
|