C++ sorting array