Hello there, i am trying to create a league table within a program, the teams points are located within individual data structs though. Can anyone help, I want the team with the most points on top , followed by the second most points ect. But i also want to output the team name alongside it.
Userteam and Oppoisition teams are individual data structs.Code:cout<<UserTeam.Teamname<<"\t "<<UserTeam.Leaguepoints<<endl; cout<<Oppositionteam1.Teamname<<"\t "<<Oppositionteam1.Leaguepoints<<endl; cout<<Oppositionteam2.Teamname<<"\t\t "<<Oppositionteam2.Leaguepoints<<endl; cout<<Oppositionteam3.Teamname<<"\t "<<Oppositionteam3.Leaguepoints<<endl; cout<<Oppositionteam4.Teamname<<"\t\t "<<Oppositionteam4.Leaguepoints<<endl; cout<<Oppositionteam5.Teamname<<"\t "<<Oppositionteam5.Leaguepoints<<endl;
I'm a new programmer so go easy