Selection sort in c++