Sorry to double post...Wasn't letting me edit for some bizarre reason.
Anyhoo, I slapped myself when I realised this piece of code:
Code:
if(LowestNumber <= CurrentNumber)
lol! I can be quite silly sometimes. So my new code switched them around...And then we have more problems! Here's the 'Selection Sort' part of the code.
Code:
for(vector<int>::iterator iter = Selected_Numbers.begin();
iter != Selected_Numbers.end(); ++iter)
{//For1
CurrentNumber = *iter;
if(CurrentNumber <= LowestNumber)
{//If1
LowestNumber = CurrentNumber;
*(Selected_Numbers.begin()) = LowestNumber;
}//Close if1
else
{//else1
cout<<"Next Number...."<<endl<<endl;
}//close else1
It works better than before...Cos before, I typed in '3, 2, 1' - and the sort turned it into '3, 2, 1'.....But now, I put in the same - and for some bizzare reason, it returns '1, 2, 1'.....
I can't seem to see where LowestNumber would pick up '1' again...And also omit the three....
Any pointers?
[Edit]...[It worked!]
Pointer(iterator) arithmitic! Damn...So I just check the next element up in the same go, compare it, and then swap if true. And then +1 to the iter...Ok, I'll give it a bash - cheers 'IloveVectors'(What an appropiate name for this situation, lol)...I'd still like to know how that 1 got there instead of the three though, lol