All pastes #744257 Raw Edit

Something

public text v1 · immutable
·published 2007-10-21 07:45 UTC
rendered paste body
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++;
}