void sortRooms()
I came up with this algorithm to sort my room struct. Inside room struct there are only 3 values (50, 120, 30) which is why I have to decrease the index by at the start and increase dec by 1 everytime. However, when i compile and it prints out
OHE 100 120
SAL 210 30
OHE 120 50
I traced out the steps on paper but I cant seem the follow why the index is not incrementing correctly so that it would go on to compare 120 with 50 and then proceed to switch those values. Any help would be appreciated.
std::sort(room.begin(), room.end(), MaxStudentsCompare)
. – Don Reba Mar 11 '14 at 6:48