First you should decide on some sorting algorithm that you want to use. A simple sorting algorithm is Bubblesort. You can find an implementation of it in the snippets section or through wikipedia.
To compare two strings you can use the function strcmp, it takes 2 strings as parameters and uses a comparator method to decide which string is smaller/larger. You can find an explanation of the function here.. http://www.cplusplus...ing/strcmp.html