1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#define NUM_TEAMS 4
#define NUM_MEMBERS 3
int teamCounter = 4;
void initialize();
struct TeamS
{
int ID;
string teamMembers[3];
};
vector <TeamS>TeamV;
int main()
{
const int ID[NUM_TEAMS] = { 123, 321, 456, 789 };
const string MEMBERS[NUM_TEAMS][NUM_MEMBERS] =
{
{ "Sarah", "Joe", "John" },
{ "Chris", "Kevin", "James" },
{ "Tom", "Kim", "Emily" },
{ "Jill", "Jason", "Jim" }
};
**initialize(TeamV, ID, MEMBERS, 3);
TeamS* t = new TeamS;
for (int i = 0; i < sizeof(ID); i++)
{
cout << ID[i];
t->ID = ID[i];
for (int j = 0; j < 4; j++)
{
for (int k = 0; k < 4; k++)
{
t->teamMembers[i] = MEMBERS[j][k];
cout << t->teamMembers[i];
}
}
TeamV.push_back(*t);
};
system("pause");
return 0;
}
void initialize(vector <TeamS> & TeamV, const int id[],
const string m[][NUM_MEMBERS], int arraySize)
{
TeamS teams;
for (int i = 0; i < sizeof(id); i++)
{
teams.ID = id[i];
for (int j = 0; j < arraySize; j++)
{
for (int k = 0; k < arraySize; k++)
{
teams.teamMembers[i] = m[j][k];
}
}
TeamV.push_back(teams);
}
}
void initialize()
{
}
|