exercises/ex13/list_errors_soln.c
int pop(Node **list) {
    int retval;
    Node *head = *list;

    if (head == NULL) {
        return -1;
    }

    Node *next_node = head->next;
    retval = head->val;
    free(head);
    *list = next_node;

    return retval;
}
/* Removes and returns the first element of a list.
*
* list: pointer to pointer to Node
*
* returns: int or -1 if the list is empty
*/
Removes and returns the first element of a list.
list: pointer to pointer to Node

int or -1 if the list is empty
Removes and returns the first element of a list . list : pointer to pointer to Node int or - 1 if the list is empty
int pop(Node **list) {
    int retval;
    Node *head = *list;
    if (head == NULL) {
        return -1;
    }
    Node *next_node = head->next;
    retval = head->val;
    free(head);
    *list = next_node;
    return retval;
}
int pop ( Node * * list ) { int retval ; Node * head = * list ; if ( head == NULL ) { return -1 ; } Node * next_node = head -> next ; retval = head -> val ; free ( head ) ; * list = next_node ; return retval ; }
Removes and returns the first element of a list.
Removes and returns the first element of a list .