I wonder something about what is happening when I sort this vector. I put some number into the vector like below. After the sort the output look like this.
3
2
1
-3
-2
-1
What I want is that the output instead will look like the below example.
Like below the numbers is sorted from highest to lowest.
How it this possible to do ?
3
2
1
-1
-2
-3
std::vector<int> Numbers;
int Number1 = - 1;
int Number2 = - 2;
int Number3 = - 3;
int Number4 = 1;
int Number5 = 2;
int Number6= 3;
Numbers.push_back(Number1);
Numbers.push_back(Number2);
Numbers.push_back(Number3);
Numbers.push_back(Number4);
Numbers.push_back(Number5);
Numbers.push_back(Number6);
std::sort(Numbers.rbegin(), Numbers.rend()); //Sort the Vector