Why your code didn't compile? A lot of reasons, which you should review in the errors and warnings. This is just from a cut/paste of your code, therefore the first line is Line 1 and so forth, I didn't edit or modify what you posted:
Code:
gcc -o quick_sort quick_sort.c
quick_sort.c: In function ‘QUICKsort_VALUE’:
quick_sort.c:8:5: error: ‘sortI’ redeclared as different kind of symbol
quick_sort.c:6:33: note: previous definition of ‘sortI’ was here
quick_sort.c:8:12: error: ‘sortJ’ redeclared as different kind of symbol
quick_sort.c:6:53: note: previous definition of ‘sortJ’ was here
quick_sort.c:10:42: error: dereferencing pointer to incomplete type
quick_sort.c:11:42: error: dereferencing pointer to incomplete type
quick_sort.c: In function ‘main’:
quick_sort.c:38:7: error: ‘st_size’ undeclared (first use in this function)
quick_sort.c:38:7: note: each undeclared identifier is reported only once for each function it appears in
quick_sort.c:38:16: error: ‘un’ undeclared (first use in this function)
quick_sort.c:38:27: error: invalid application of ‘sizeof’ to incomplete type ‘struct st’
quick_sort.c:40:1: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__off_t’ [-Wformat]
I go backwards because when you fix stuff it changes the line numberings so I usually start at the end and fix backwards when most plausible:
Line 40: You need to look up what the contents of a struct stat structure is, because st_size is not an integer, or you need to cast.
Line 38, column 7: You can't figure out what's wrong there? It's a typing mistake.
Line 38, column 16: Should be equally obvious
Line 38, column 27: Because it should be sizeof(struct stat) or sizeof(st)
Lines 6, 8, 10, and 11: The main issues here are that to take generic pointers and cast them to a structure, you should declare the local pointers to match what you wish to cast it too. You cannot take passing arguments of a function and reuse those names. The errors on line 8 are complaining that you're attempting to redefine the variable types of the function's passing arguments.
Suggestions for that section:
Code:
int QUICKsort_VALUE(void *sortI, void *sortJ)
{
struct st *pSortI, *pSortJ;
int sortIVal, sortJVal;
pSortI = (struct st *)sortI;
pSortJ = (struct st *)sortJ;
sortIVal = pSortI->value;
sortJVal = pSortJ->value;