Hello,
I was wondering how I could possibly organize one vector by placing it into an another. (Note: They are vector of objects). What i have so far is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
double done;
for ( int i = 0; i < id; i++ )
{
done = guy[i].done();
int smallest = i;
for( int j = i + 1; j < id; j++ ){
if( done > guy[j].done() )
{
done = guy[j].done();
smallest = j;
}
}
newGuy.push_back( guy[smallest] );
}
This doesn't organize every part of the vector, and sometimes even copies the same guy into the newGuy. Any ideas?