Assignment Operator List& List::operator=(const List &o) { if (this == &o) return *this; Node *c = head; while (c) { Node *r = c; c = c->next; delete r; } if (o.head == NULL) head = NULL; else { // insert rest of copy code } return *this; }