Sort an array in C (Basic Method)