Question: void order_two_players(player_t* player1_p, player_t* player2_p) { player_t *tmp = player1_p; player1_p = player2_p; player1_p = tmp; /* This function compares two players. If *player1_p is
void order_two_players(player_t* player1_p, player_t* player2_p)
{
player_t *tmp = player1_p;
player1_p = player2_p;
player1_p = tmp;
/*
This function compares two players. If *player1_p is older than the *player2_p,
swap them. In all other cases, do not swap them.
Inputs:
player1_p - memory location of the first player
player2_p - memory location of the second player
Post:
After the function has been called, the age of *player1_p is always less than
or equal to *player2_p age.
Correct output:
player1: player - age:32 wickets:300
player2: player - age:22 wickets:070
after order_two_players
player1: player - age:22 wickets:070
player2: player - age:32 wickets:300
*/
}
How I can fix it?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
