Are you saying you googled "sort c" and found NOTHING? I see several helpful links when I do that. For example, have a look at this question and its answers: C library function to do sort. Also the Wikipedia article on suffix arrays gives good overview of methods of constructing suffix arrays: O(N) method of constructing a suffix tree and then the suffix array, O(N^2 log N) method of sorting the suffixes (sorting requires O(N log N) comparisons, and each comparison is O(N), so the total time is O(N^2 log N)), and other advanced methods. The Wikipedia article also points to a few implementations in Java, C/C++ etc.