#include "stdafx.h" / * qsort.c: this program reads the command-line * parameters and uses qsort to sort the. it * The displays the sorted arguments. * /
#include #include #include
INT COMPARE (const void * arg2);
Void main (int Argc, char ** argv) {char A [255] = "1723649/0"; int K = strlen (a); QSORT ((void *) a, (size_t) strlen (a), Sizeof CHAR), Compare); Printf ("% s", a);}
INT COMPARE (Const Void * Arg1, Const Void * Arg2) {RETURN - ((CHAR *) ARG1) [0] - (CHAR *) Arg2) [0]); // Descending, this value takes a negative Ascending order}