>>quicksort(array, s);

You don't want to sort the whole array, only the elements that have real data in them, so use:

>>quicksort(array, i);

Change this bit:

to this (note, no "while" loop needed)Code:while(array != NULL){ //Puts the numbers back into a new file for(n=0; n <101; n++){ fprintf(quick, "%d\n", array[n]); } }

Change thisCode:for (n = 0; n < i; n++) { fprintf(quick, "%d\n", array[n]); }

>>for(b=a=1;b<size;b++){

to this

for (b = a; b < size; b++)

See how you go, that may not be all necessary changes, but it should get you moving.