Sorting a String Array Alphabetically C++ -
i'm trying write program given following structures: struct aplayer { string name; // name of player int wins; // number of wins player has }; struct acompetition { string name; // name of match int numplayers; // number of players in club aplayer player[10]; // list of players in club }; from there want write function sort players name alphabetically. function declaration follows: void sortbyname(acompetition & c){} note: using loops, while loops, , if statement(s). way think compare 2 strings compare ascii values. i'm not sure how input appreciated. thanks! assuming homework (and if it's not, doing lot more seeing answer,) i'm going give few pointers out. compare ascii values: aplayer player1, player2; player1.name = "bill"; player2.name = "john"; if (player1.name[0] < player2.name[0]) { // true, in case, because b less j on ascii table. } http://www....