int main () { Employee emp1 (101, "sachin1"); Employee emp4 (102, "sachin2"); Employee emp2 (103, "sachin3"); Employee emp3 (104, "sachin4"); Stack<Employee> st2; st2.Push(emp1); st2.Push(emp2); st2.Push(emp3); st2.Push(emp4); st2.List(); cout << "--------------------------------------------" << endl; st2.Sort(); st2.List(); cout << "--------------------------------------------" << endl; return 0; }
int whichEmpty(const ECString& emp) { //return 1; // should make system not require empty type to be correct. if(emp == "0") return NULLEMP; if(emp == "*U*") return UNITEMP; int sz = emp.length(); if(sz < 1) { return 0; } if(sz >= 5) { //ECString emp1(emp.substr(0, 5)); ECString emp1(emp,0,5); if(emp1 == "*NOT*") return NOTEMP; if(emp1 == "*RNR*") return RNREMP; if(emp1 == "*ICH*") return ICHEMP; if(emp1 == "*EXP*") return EXPEMP; if(emp1 == "*PPA*") return PPAEMP; } if(sz >= 3) { //ECString emp1(emp.substr(0, 3)); ECString emp1(emp,0, 3); if(emp1 == "*T*") { return TREMP; } if(emp1 == "*NOT*") return NOTEMP; if(emp1 == "*?*") return QEMP; } //ECString emp2(emp.substr(0,1)); ECString emp2(emp,0,1); if(emp2 == "*") return NPEMP; return 0; }