next up previous contents
Next: The Overloaded Operator =: Up: The Definition File mycomplex.c: Previous: The Overloaded Operator -:

The Overloaded Operator - =:

//====================================================//
//                                                    //
//                Overloaded -=                       //
//                                                    //
//====================================================//
MYCOMPLEX& MYCOMPLEX::operator-=(const MYCOMPLEX &w)
{
real = real - w.real;
imaginary = imaginary - w.imaginary;
return *this;
}
MYCOMPLEX& operator-=(MYCOMPLEX& w,const int& i)
{
w.real = w.real - (double)i;
return w;
}
MYCOMPLEX& operator-=(MYCOMPLEX& w,const float& x)
{
w.real = w.real - (double)x;
return w;
}
MYCOMPLEX& operator-=(MYCOMPLEX& w,const double& x)
{
w.real = w.real - x;
return w;
}



Jim Peterson
1999-04-22