I have a vector<purchases> v where purchases is defined as:
struct purchases
{
string name;
int amount;
string item;
};
vector<purchases> v;
I need to find the 3 top buyers.
ie. the name of the top 3 people with the highest accumulated amount.
The problem I have is when I sort the values the same buyer can appear in the top 3 more than once.
I need to combine way to combine all of the amounts from the same buyer before comparing them. Any ideas on how to do this??