home *** CD-ROM | disk | FTP | other *** search
- // \EXAMPLES\EX0903.CPP
-
- //---------------------------------------------------------
- // files in this example:
- // %F,15,EX0900.H%EX0900.H definition of Fraction class
- // %F,15,EX0900.CPP%EX0900.CPP Fraction members & friends
- // EX0903.CPP this file
- //---------------------------------------------------------
-
- #include <iostream.h>
- #include "EX0900.H"
-
- void main ()
- {
- Fraction y(0.5);
- cout << "The initial value of y is: ";
- cout << y;
-
- cout << endl;
- cout << " The value of y is: ";
- cout << y;
- cout << " The value of -y is: ";
- cout << -y;
-
- cout << endl;
- cout << " The value of y is: ";
- cout << y;
- cout << " The value of y.operator-() is: ";
- cout << y.operator-();
- }