The program below can compare time which is generated by class CTime but it seems not working properly. Please help to fix it.
#include <iostream>
#include <cstdlib>
using namespace std;
class CTime
{
private:
int hour,min;
double sec;
public:
//Your code from here
//to here
};
int main(void)
{
CTime t1(4,13,51.3);
CTime t2(5,44,30.3);
if(t1>t2)
cout << "t1 is larger than t2" << endl;
else
cout << "t2 is larger than t1" << endl;
if(t1<t2)
cout << "t1 is smaller than t2" << endl;
else
cout << "t2 is smaller than t1" << endl;
system("pause");
return 0;
}