#include //for div #include "date3.h" using namespace std; date3& date3::operator++() { if (++day > length[month]) { day = 1; if (++month > 12) { month = 1; ++year; } } return *this; } date3& date3::operator+=(int count) { div_t d = div(count, 365); if (d.rem < 0) { //Make sure remainder is non-negative. d.rem += 365; --d.quot; } year += d.quot; for (day += d.rem; day > length[month];) { day -= length[month]; if (++month > 12) { month = 1; ++year; } } return *this; }