I'm trying to write a program that is given the following structures:
struct aPlayer {
string name; // name of player
int wins; // number of wins player has
};
struct aCompetition {
string name; // name of the match
int numPlayers; // number of players in the club
aPlayer player[10]; // list of players in this club
};
From there I want to write a function that will sort the players by name alphabetically. The function declaration would be as follows:
void sortByName(aCompetition & c){}
Note: I would like to do this by only using for loops, while loops, and if statement(s). The only way I could think to compare the two strings would be to compare their ASCII values. I'm not sure how to do that so any input will be greatly appreciated. Thanks!