Homework question out of the textbook "Modify the qsort.c program of section 9.6 so that low, high and middle are pointers to array elements rather than integers. The split function will need to return a pointer not an integer." 

qsort.c Code:

```
#include <stdio.h>
#define N 10

void quicksort(int a[], int low, int high);

int split(int a[], int low, int high);

int main(void)

{

int a[N], i;

printf("Enter %d numbers to be sorted: :", N);

for (i=0; i<N; i++)

    scanf("%d", &a[i]);

    quicksort(a, 0, N - 1);

    printf("In sorted order: ");
    for (i=0; i<N; i++)
        printf("%d ", a[i]);
    printf("\n");

    return 0;
}

void quicksort(int a[], int low, int high)
{
    int middle;

    if (low >= high) return;
    middle = split(a, low, high);
    printf("Low");
    printf("%d", low);
    quicksort(a, low, middle - 1);
    quicksort(a, middle + 1, high);
}

int split(int a[], int low, int high)
{
    int part_element = a[low];

    for (;;) {
        while (low < high && part_element <= a[high])
            high--;
        if (low >= high) break;
        a[low++] = a[high];

        while (low < high && a[low] <= part_element)
            low++;
        if (low >= high) break;
        a[high--] = a[low];

    }

    a[high] = part_element;
    return high;
}

```

My Attempt at the Solution:

```
#include <stdio.h>

#define N 10

void quicksort(int a[], int *low, int *high);
int split(int a[], int *low, int *high);

int main(void)
{
int a[N], i;
int zero, nminus;
printf("Enter %d numbers to be sorted: :", N);
for (i=0; i<N; i++)
    scanf("%d", &a[i]);
    zero=0;
    nminus=N-1;
    quicksort(a, &zero, &nminus);

    printf("In sorted order: ");
    for (i=0; i<N; i++)
        printf("%d ", a[i]);
    printf("\n");

    return 0;
}

void quicksort(int a[], int *low, int *high)
{
    int *middle;
    int splitt;
    if (low >= high) return;
    splitt = split(a, low, high);
    middle = &splitt;

    quicksort(a, low, middle - 1);
    quicksort(a, middle + 1, high);
}

int split(int a[], int *low, int *high)
{
    int low1, high1;
    low1= *low;
    high1= *high;
    int part_element = a[low1];

    for (;;) {
        while (low1 < high1 && part_element <= a[high1])
            high1--;
        if (low1 >= high1) break;
        a[low1++] = a[high1];

        while (low1 < high1 && a[low1] <= part_element)
            low1++;
        if (low1 >= high1) break;
        a[high1--] = a[low1];

    }

    a[high1] = part_element;
    return high1;
}

```

I am new to c-programming and am unsure how to make this program work correctly. This attempt debugs successfully however it just spits out the input without sorting it. Any help is appreciated.