Category : Files from Magazines
Archive   : CUJ9203.ZIP
Filename : 1003075A

 
Output of file : 1003075A contained in archive : CUJ9203.ZIP


Listing 8

//
// rational.cpp
//
#include "mylib.h"
#include "rational.h"

rational rational::operator-()
{
rational result(*this);
result.num = -result.num;
return result;
}

rational rational::operator++(int)
{
rational result(*this);
*this += 1;
return result;
}

rational rational::operator--(int)
{
rational result(*this);
*this -= 1;
return result;
}

// ... the rest of rational.cpp as in Listing 2