I wrote this code:
shuffledteamnames[8][80]; // global
winningteamnames[8][80]; // global
int main()
{
if (team1 > team2)
{
cout << shuffledteamnames[index1] << " beat the " << shuffledteamnames[index2] << " " << team1 << "-" << team2 << " in a game 1." << endl;
winningteamnames[WINTEAMcounter] = shuffledteamnames[index1];
}
else if (team1 < team2) // index1 = 0, index2 = 1, WINTEAMcounter = 0
{
cout << shuffledteamnames[index2] << " beat the " << shuffledteamnames[index1] << " " << team1 << "-" << team2 << " in a game 1." << endl;
winningteamnames[WINTEAMcounter] = shuffledteamnames[index2];
}
}
The output of shuffledteamnames is something like this:
Trojans
Bruins
Bears
Trees
Ducks
Beavers
Huskies
Cougars
I am trying to create a competition bracket where I take the winners of each round and place them into char array winningteamnames. I understand that these are 2D char arrays so I need to input data into both parameters, but I'm just not sure how to do that. Please let me know if I was vague at any point and I really appreciate all the help.
chartype in your declarations of the team name arrays? Why don't you usestd:string