list.cc
/* Append a node with value VAL to the list HEAD.  */
Append a node with value VAL to the list HEAD.
Append a node with value VAL to the list HEAD .
static void
append (node **head, int val)
{
  node *l = new node{val, nullptr};
  node **indirect = head;
  while (*indirect)
    indirect = &(*indirect)->next;
  *indirect = l;
}
static void append ( node * * head , int val ) { node * l = new node { val , nullptr } ; node * * indirect = head ; while ( * indirect ) indirect = & ( * indirect ) -> next ; * indirect = l ; }
Append a node with value VAL to the list HEAD.
Append a node with value VAL to the list HEAD .