i'm getting the following error for my code:
type 'Date' does not provide a call operator
whenever i try to do the following code:
date1++(25)
This is the postfix operator code here. What's wrong with it?
Date Date::operator++(int)
{
Date days(month, day, year);
days.increment();
return days;
}
increment function:
void Date::decrement()
{
//check if the day is the 1st of the month
if (day == 1)
{
day = 30;
//check the month and yar. if it's the first month then we decrease the year by 1 and change month to 12
if (month == 1)
{
month = 12;
year = year - 1;
return;
}
// if the month is not 1, then we decrease month by 1
month = month - 1;
return;
}
else {
//otherwise we just decrease day by 1
day = day - 1;
return;
}
}