Answers for "equals operator c++ overlaod"

C++
0

equals operator c++ overlaod

MyClass& MyClass::operator=(const MyClass &rhs) {

    // Only do assignment if RHS is a different object from this.
    if (this != &rhs) {
      ... // Deallocate, allocate new space, copy values...
    }

    return *this;
  }
Posted by: Guest on November-17-2020

Browse Popular Code Answers by Language