my complier is throwing an error up when i run it. the problem is run into is my Increment function is etither given a number to increment by, or if it is left blanlk (Increment()) should default to incrementing 1.
i thought i could do just 2 functions, one with a parameter given and the other without(kinda like what you do for constructors). still throwing errors. how would i make it with/without parameters in one function?
void Date::Increment(int numDays)
{ int newDay=0;
if(day+numDays > DAYINMONTH[month])
{ (month=month+1);
newDay = (day+1)-DAYINMONTH[month];
(day = newDay + 0);
}
else
{day = day + numDays;}
}
void Date::Increment()
{
int newDay=0,numDays;
if(day+numDays > DAYINMONTH[month])
{ (month=month+1);
newDay = (day+1)-DAYINMONTH[month];
(day = newDay + 0);
}
else
{day = day + numDays;}
}