ft_lstmap

Subject

FT_LSTMAP (simplified)

NAME
    ft_lstmap -- creates a new list resulting from the application of f to each element
SYNOPSIS
    t_list *ft_lstmap(t_list *lst, void (*f)(void *), void (*del)(void *));
DESCRIPTION
    Iterate over the list 'lst' and apply the function 'f' to the content of each elements. Create a new list resulting of the successive applications of 'f'. The function 'del' is used to destroy the content of an element if necessary.
PARAMETERS
    lst: pointer address to one element
    f: the address of the function to apply
    del: the address of the function that can delete an element's content
RETURN VALUES
    None
AUTHORIZED EXTERNAL FUNCTIONS
    None

Understandable explanation

This functions works similarly as the ft_lstiter function, but it creates a new list resulting of the successive applications of f on each element's content.

Hints

Commented solution

ft_lstmap

Last updated

Was this helpful?