Overloading - and =The operator -(O) can be implementedsimilarly to operator+O, and we omit thedetails.We focus on the assignment operatorfunction, operator=O
Overloading – and = The operator –() can be implemented similarly to operator+(), and we omit the details. We focus on the assignment operator function, operator=()
Example: operator=()void coord::operator=(coord ob2) ^x = ob2.x;y = ob2.y;7int mainO coord o1(4,6), 02;02 = 01;return O;7
Example: operator=() void coord::operator=(coord ob2) { x = ob2.x; y = ob2.y; } int main() { coord o1(4,6), o2; o2 = o1; return 0; }