// To which division does this project belong? Each project belongs
// to one division, but a division may have many projects.
Division* getDivision() const {return theDivision;}
void setDivision(Division* publ) {theDivision = publ;}
// The project ID is a unique identifier for the project.
std::string getProjectID() const {return theProjectID;}
void setProjectID(std::string projectID) {theProjectID = projectID;}
// Budget codes indicate to whome this project is charged.
std::string getBudgetCode() const {return theBudgetCode;}
void setBudgetCode(std::string projectID) {theBudgetCode = projectID;}
// Operations on Project
// Add a staff member to the project. Staff should be kept in alphabetic
// order by name.
void addStaff(const Staff&);
int numberOfStaff() const;
// Access to list of staff assigned to this project
iterator begin() const;
iterator end() const;
int numStaff;
int theMaxStaff;
Staff* staff; // array of Staff
static const int DEFAULT_MAXSTAFF = 12;
};
#endif
So.....
When overloading the < operator, I want to compare theProjectID using the sort algorithm. The function call looks like this:: sort (projects, projects+div.numberOfProjects());
I need it to first compare the numerical portion of the data, the 3000 example given, and if they have the same numerical value, it needs to compare the alphabetical portion in order, which I have crudely pseudo-coded above as (suffix).
Any idea on how to separate the numerical data from the char data of an unknown data type stored in an ADT for comparisons accomplished by an overloaded comparison operator?