How to invert order in QuickSort

Hello! Iam trying to reverse my order of quicksort in C from asc order (1-99) that is the original way of the algoritm, to descending (99-1). I've tried so many ways that iam a kind of lost now!:s

The original quicksort is:

void swap(int* a, int* B) {
  int tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
}
 
int partition(int vec[], int left, int right) {
  int i, j;
 
  i = left;
  for (j = left + 1; j <= right; ++j) {
    if (vec[j] < vec) {
      ++i;
      swap(&vec, &vec[j]);
    }
  }
  swap(&vec, &vec);
 
  return i;
}
 
void quickSort(int vec[], int left, int right) {
  int r;
 
  if (right > left) {
    r = partition(vec, left, right);
    quickSort(vec, left, r - 1);
    quickSort(vec, r + 1, right);
  }
}

Thanks for all! Good work!

You should be using the qsort library function in stdlib.h If you can't use that then this is probably homework, which means this should be reposted over there in the homework forum.

For qsort there needs to be a comparison function, let's call it compar()
it returns: 0 on equal, +1 when a is larger, -1 when b is larger:

int compar(const void *a, const void *b)
{
    const int *a1=(const int *)a;
    const int *b1=(const int *)b;
    return *b1 - *a1;
}

This one sorts 99 -> 1, in reverse order.
flip the position of *a1 and *b1 in the subtraction statement to sort 1->99