This is for a little database program i'm writing.
It should sort the vector from highest price ( getPrijs() ) to lowest and show it.
But for some reason it just shows them backwards (on ID)
For example:
Wouldn't work...I need to keep the vectors as they are...
Unless I'm understanding it wrong. What I understand:
It switches integers so that vector[0] would contain the highest?
Well, you can either operate on a copy of the vector or on a (temporary) vector of pointers to the original elements.
Besides, data.erase(pos); isn't exactly "keeping the vectors as they are", is it?