aboutsummaryrefslogtreecommitdiff
path: root/benchmark/sort.c
blob: 657d2bed6865d75cf59e41c93f48a7443e5395dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

extern int array[];
extern int size;

int compare(const void *a, const void *b)
{
	return *(int *)a - *(int *)b;
}

int main(int argc, char *argv[])
{
	int len = (int)&size; // ??
	qsort(array, len, sizeof(int), compare);
	for (int i = 0; i < len; i++)
		printf("%d\n", array[i]);
	return 0;
}