Listing 14 Uses some Date comparison operators
// tdate5.cpp #include <iostream.h> #include "date3.h" main() { Date d1(10,1,1951), d2(3,7,1995); cout << "d1 == " << d1 << endl; cout << "d2 == " << d2 << endl; cout << "d1" << ((d1 < d2) ? "precedes" : (d1 > d2) ? "follows" :"equals") << "d2" << endl; return 0; } /* Output: d1 == October 1, 1951 d2 == March 7, 1995 d1 precedes d2 */ // End of File