#ifndef DATEH #define DATEH #include //for ostringstream #include using namespace std; class date { int year; int month; int day; public: date(int initial_month, int initial_day, int initial_year) : year(initial_year), month(initial_month), day(initial_day) {} date() { const time_t t = time(0); const tm *const p = localtime(&t); year = p->tm_year + 1900; month = p->tm_mon + 1; day = p->tm_mday; } friend ostream& operator<<(ostream& ostr, const date& d) { return ostr << d.month << "/" << d.day << "/" << d.year; } operator string() const { ostringstream ost; ost << *this; //calls line 24: operator<<(ost, *this); return ost.str(); } }; #endif