What would be the simplest way to alpha sort an array of chars in C?
问题 I'm looking for a simple, easy to understand algorithm to alphabetically sort an array of characters in C. 回答1: characters in C have numeric values that happen to be in order, so you just treat your characters like integers. the C standard library includes a 'qsort' function. Use that ( man qsort on a linux-like system). You might have to convert upper-case letters to lowercase to simplify things, but that's trivial. If you want to understand the quicksort algorithm (that's the one you should