C++ selection sort