overload operator >
I have overloaded operator > in my Date class
1 2 3
|
bool operator> (Date param) {return (this->day > param.day);};
bool nextDay;
|
I am then calling like this:
|
nextDay = flight2.arrivalDate > flight2.departureDate;
|
it is not however working.
nextDay is declared globaly, Date is a subclass for a Flight class.
any ideas?
correction:
it works if I just want to test it in main:
1 2 3
|
nextDay = flight4.arrivalDate > flight3.departureDate;
if (nextDay)
cout << "NEXT DAY";
|
but I need to put it in a method that is being called by a function, and then it doesn't work
This isn't enough information to figure out the problem. Please post all of your code, or at least a complete program that demonstrates the problem.
sorry, I moved things around and the problem got fixed.
thanks for your interest
Topic archived. No new replies allowed.