I am trying to overload the <= operator but the program has an error
Process finished with exit code -1073741571 (0xC00000FD)
op.h
bool operator<=(const Date& d1, const Date& d2)
{
return d1 <= d2;
}
main.cpp
cout << "Checking <=" << endl;
assert(Date(1,1,2000) <= Date(2,1,2000));
assert(!(Date(2,1,2000) <= Date(1,1,2000)));
assert(Date(2,1,2000) <= Date(1,2,2000));
assert(Date(2,2,2000) <= Date(1,1,2001));
cout << "Checking <= Complete!" << endl;
What is happening here?
Aucun commentaire:
Enregistrer un commentaire