Category : Files from Magazines
Archive   : CUJ9201.ZIP
Filename : 1001097B

 
Output of file : 1001097B contained in archive : CUJ9201.ZIP


Listing 7

//
// rational.h
//
#include

class rational
{
public:
rational() { }
rational(long n, long d) : num(n), denom(d) { }
rational operator+(rational r);
rational operator-(rational r);
rational operator*(rational r);
rational operator/(rational r);
rational &operator+=(rational r);
rational &operator-=(rational r);
rational &operator*=(rational r);
rational &operator/=(rational r);
void put(FILE *);
private:
long num, denom;
};