struct players {
string team_name;
string driver;
string navigator;
double best_time; } world[32];
I am generating random values for the best time and using a bubble sort in ascending order for the best time. See below. How do I sort for best time but retain my team name, driver and navigator?
------------------------------------------
double temp;
int a, b;
for (a=0; a < 32;a++)
{
for (b=0; b<32-a-1; b++)
if (world[b].best_time < world[b+1].best_time)
{
temp = world[b].best_time;
world[b].best_time = world[b+1].best_time;
world[b+1].best_time = temp;
}