The problem is that when you do something like Push(&beast, 6); , what beast indicates is not changed by the Push function. Despite the fact that Push adds more elements to the linked list, when you call Length on beast later, it calls it on the same node that the beast originally had at the beginning, so that it does not completely know the additional nodes added.
At the end of Push () you need to do the following:
*headRef = newNode;
so that beast correctly points to a new start to the list.
source share