void insertAfterLast(ListRef L, int data){ NodeRef M = newNode(data); if(L==NULL){ printf("List Error: calling insertAfterLast() on NULL Listref\n"); exit(1); } if(isEmpty(L)){ L->front = L->back = M; } else{L->back->next = M; L->back = M;} L->length++; }