The program below makes two classes that when calling their generate functions in a .cpp file generates a list of soldiers and then a separate list of skills, I want to combine these 2 lists,that way you can say Soldier 1 has skill 1,4,7 while Soldier 2 has 3,4,5,6,7,8. How would I go about putting these two lists together? In the end I want the user to be able to type in a group of skills he is looking for and then the program make a team consisting of 5 soldiers where each skill the user specified is held by at least two members
class skill
{
public:
skill(){}
skill(int i){x=i;}
~skill(){}
bool operator == (skill s){return (x==s.getx());}
void operator = (skill s){x=s.getx();}
void display(){cout<<"a"<<x<<" ";}
void generate1(list<skill>*S);
private:
int x;
};
class soldier
{
public:
soldier(){}
soldier(int i){x=i;}
~soldier(){}
bool operator == (soldier s){return (x==s.getx());}
void operator = (soldier s){x=s.getx();}
void display(){cout<<"S"<<x<<" ";}
void generate2(list<soldier>*S);
private:
int x;
};