#include // class declaration class Date { private: int month; int day; int year; public: Date(int = 7, int = 4, int = 2001); // constructor int operator==(Date &); // declare the operator== function }; // implementation section Date::Date(int mm, int dd, int yyyy) { month = mm; day = dd; year = yyyy; } int Date::operator==(Date &date2) { if(day == date2.day && month == date2.month && year == date2.year) return 1; else return 0; } int main() { Date a(4,1,1999), b(12,18,2001), c(4,1,1999); // declare 3 objects if (a == b) cout << "\nDates a and b are the same." << endl; else cout << "\nDates a and b are not the same." << endl; if (a == c) cout << "Dates a and c are the same.\n" << endl; else cout << "Dates a and c are not the same.\n" << endl; return 0; }