Overloading the Unary '-' Operator

We will overload the unary minus operator such that it will negate a complex object. A unary minus operator - has only one operand. As there is only one operand, they are overloaded as member functions and we will do the same here. The prototype of the operator function for overloading unary minus operator when implemented as a member function is:

const Complex operator- () const;

The operator- function is implemented in the following manner: