<keywords content="C,language"/>
int compare_doubles (const double *a, const double *b) { double temp = *a - *b; if (temp > 0) return 1; else if (temp < 0) return -1; else return 0; } main() { double *array; int size; ... qsort (array, size, sizeof (double), compare_doubles); }
#define COMMAND(NAME) { #NAME, NAME ## _command } struct command commands[] = { COMMAND (quit), COMMAND (help), ... };