std::list <unsigned int> Numbers;
for (unsigned int i = 0; i < 100; i++) {
Numbers.push_back(rand() % 9500);
}
Okay, so we have that piece of code. Right?
What I want to do now is to output all those numbers from lowest to highest.
Like, (31, 52, 60, 79) and not (85, 20, 852, 521)
So now you may be thinking: "Oh, that's just to swap the numbers and sort them like that."
But the thing is, I don't want to swap the numbers inside the list...
I want to simply just get the lowest number in the list like...
OutputNumbersFromLowestToHighest(Numbers);
And then it'd give me the answer. And again, I don't want anything in the Numbers list to change, I just want it read.
Thanks in advance