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.
I'm a new programmer so go easy :D
In a nutshell:
- Create a container to store data for your individual teams (an array or vector of structs for example).
- Define operator< (less than) for your team structs.
- Call the std::sort function.
- Print contents of newly sorted container from start to finish.
Probably less detail than you want... but lets see what you can make of that as a starting point.