C
Chiller
I wish to implement overloads of six comparison operators (==, !=, <,
<=, >, >=), which will return true or false when comparing two distance
values.
I've added the code below to my Distance class (posted earlier in another
thread)
to do the == overload, it compiles correctly but
I'm not sure how to make it return the bool true or false. Could someone
please explain what I'm doing wrong and how to correct the problem.
Thanks,
Distance & Distance :: operator== (Distance const & right_operand)
{
nu = right_operand.nu;
me = right_operand.me;
return *this;
}
<=, >, >=), which will return true or false when comparing two distance
values.
I've added the code below to my Distance class (posted earlier in another
thread)
to do the == overload, it compiles correctly but
I'm not sure how to make it return the bool true or false. Could someone
please explain what I'm doing wrong and how to correct the problem.
Thanks,
Distance & Distance :: operator== (Distance const & right_operand)
{
nu = right_operand.nu;
me = right_operand.me;
return *this;
}