Hi;
can you check this for me :
Time Time::operator-( Time & other, Time & other2)
{
Time t3;
t3.hrs=fabs(other.hrs-other2.hrs);
t3.mins=fabs(other.mins-other2.mins);
t3.secs=fabs(other.secs-other2.secs);
return t3;
}
bool Time::operator!=(const Time &other)
{
return (hrs!=other.hrs || mins!=other.mins || secs!=other.secs);
}
this error apear while runing the prog.
: error C2804: binary 'operator -' has too many parameters
: error C2676: binary '-' : 'class Time' does not define this operator or a conversion to a type acceptable to the predefined operator
: error C2511: '-' : overloaded member function 'class Time (class Time &,class Time &)' not found in 'Time'
see declaration of 'Time'
this in main :
t1.settime(2,13,12);
t1.gettime(hrs,mins,secs);
t2.settime(4,17,12);
t2.gettime(hrs,mins,secs);
t3=t1-t2;
t3.gettime(hrs,mins,secs);