//************************************** // Name: Quicksort demo // Description:Quicksort demo // By: Mike Smith // // // Inputs:None // // Returns:None // //Assumes:None // //Side Effects:None //************************************** #include <stdio.h> #include <stdlib.h> #include <string.h> int lettercompare(const void *a, const void *b) { const char* achar=(const char*)a; const char* bchar=(const char*)b; return *achar - *bchar; } int main(void) { char sentence[80]; strcpy(sentence,"the quick brown fox jumped over the lazy dogs."); int length=strlen(sentence); qsort(sentence, length, 1, &lettercompare); printf(sentence); }