ft_lstlast

Subject

FT_LSTLAST (simplified)

NAME
    ft_lstlast -- get the last element of the list
SYNOPSIS
    t_list *ft_lstlast(t_list *lst);
DESCRIPTION
    Returns the last element of the list
PARAMETERS
    lst: the start of the list
RETURN VALUES
    Last element of the list
AUTHORIZED EXTERNAL FUNCTIONS
    None

Understandable explanation

I think that for this one the subject is clear enough, we have to return a pointer to the last element of the list, it's pretty easy to understand.

Hints

For this one, we basically have to do the same thing as for the ft_lstsize function but we don't need to count how many elements are in the list nor return the count, but we directly return the tmp element.

Commented solution

ft_lstlast

Last updated

Was this helpful?