Qsort: Difference between revisions

Content deleted Content added
this now compiles; also, a style thing in comments, and style with `sizeof`
Line 14:
#include <stdlib.h>
 
/* Comparison function. Receives two genericconst (void) pointers. */
int comparecompare_ints(const void *p, const void *q) {
int x = *(const int *)p;
int y = *(const int *)q;
Line 31:
/* Sort an array of n integers, pointed to by a. */
void sort_ints(int *a, size_t n) {
qsort(a, n, sizeof(int) *a, compare()&compare_ints);
}
</source>