write a function SORTPOINTS() in c++ to array of structure game in
descending order of points using bubble sort. [CBSE 2009]
struct game
{
long pno; //player number
char pname[20; //player name
long points;
};
void sortpoints( game g[], int n)
{ game temp;
for( int i=0; i<(n-1); i++)
{ for( int j=0; j<(n-i-1);j++)
{ if( g[j].points<g[j+1].points)
{ temp=g[j];
g[j]=g[j+1];
g[j+1]=temp;
}
}
}
}