Original Post
I have a struct like so ..
[source lang="cpp"]
struct STUFF
{
int points;
string first_name;
string last_name;
}
[/source]
I have a vector stuffs and i wanted to sort the data inside from highest to lowest using the pts value. Is something like that possible?
I havent used c++ in a while and i started fleshing out this program and was stumped on this problem. Im going to be displaying the players according to the pts value in each struct so the person with the most points should be at index [0] and the last place person at the last index.
Im gonna keep at it but i think that any ideas i might be having might be too complicated and a more elegant solution may exist.
Thanks in advance for any help and replies.
[source lang="cpp"]
struct STUFF
{
int points;
string first_name;
string last_name;
}
[/source]
I have a vector
I havent used c++ in a while and i started fleshing out this program and was stumped on this problem. Im going to be displaying the players according to the pts value in each struct so the person with the most points should be at index [0] and the last place person at the last index.
Im gonna keep at it but i think that any ideas i might be having might be too complicated and a more elegant solution may exist.
Thanks in advance for any help and replies.