Skip to content

Overloading

Delton Hughes edited this page Apr 29, 2023 · 1 revision

Overloading

Definition: Is a form of polymorphism, it overrides the meaning of an operator. Code Example:

void operator=(const MyVector &rhs) {
    if (&rhs == this)
      return;

    if (head) {
      this->deleteV();
    }
    Node *travel = rhs.head;
    while (travel) {
      this->pushRear(travel->data);
      travel = travel->next;
    }
  }
  • Each term will have as follows: -> A definition on the term -> A code example some being in great detail if needed, for example a class example is going to be longer than a member variable. -> Lastly, a picture which in some way relates to the term but may also relate to other terms as well.
Clone this wiki locally