Hello,
I am not sure why, when I call my method, it goes into a continuous loop and prints out nothing. The operator - method is suppose to be able to subtract a Date object and a Date argument.
I will clarify if anything needs clarifying, thanks for the help
int Date::operator-(const Date& d) const
{
Date temp(myMonth,myDay,myYear);
Date copy = d;
int count = 0;
if(temp < copy)
{
while (temp != copy)
{
temp++;
count++;
}
return count * -1;
}
else if(temp > copy)
{
while(temp!= copy)
{
temp--;
count++;
}
return count;
}
if(temp == copy)
return 0;
}