I am trying to read in a file from class Flight which I already made. I believe I've read in the file correctly, but when I go to sort it by departure time, it does output how I want it to. Namely, in a 24 hour format, but it seems to chop off the colon and remaining minutes.
/*sort.h*/
#include "std_lib_facilities_4.h"
#include "flight.h"
usingnamespace std;
class Sort {
protected:
unsignedlong num_cmps; // number of comparisons performed in sort function
public:
virtualvoid sort(vector<Flight>& data) = 0; // main entry point
bool testIfSorted(const vector<Flight>& data); // returns false if not sorted
// true otherwise
unsignedlong getNumCmps() { return num_cmps; } // returns # of comparisons
void resetNumCmps() { num_cmps = 0; }
};
class SelectionSort:public Sort { // SelectionSort class
public:
void sort(vector<Flight>& data); // main entry point
};
class BubbleSort:public Sort { // BubbleSort class
public:
void sort(vector<Flight>& data); // main entry point
};
I realize, I could read in an int, that a char for the colon, then another int but I'm not sure how to do this without making a mess out of my code. Any suggestions would be appreciated.