1. ## help with quicksort

i have come back into praticing my c skills, and i came across an error with
using my quicksort algorithm.

Code:
```#include<stdio.h>

void Swaparray( int  array1, int array2);
int Partition(int *array, int begin, int end, int pivotIndex);
void Quicksortnum(int *array, int begin, int end);

int main(void)
{
int numbers[10];
int i;
for(  i = 0; i < 10; ++ i)
{
printf("Enter a number: ");
scanf("%d", &numbers[i] );
}

Quicksortnum(&numbers, 0, 10);

for( i = 0; i < 10; ++i)
{
printf(" array[%d] = %d",i,numbers[i]);

}

getchar();

return 0;
}

void Swaparray( int array1, int  array2)
{
int temp = array1;
array1 = array2;
array2 =  temp;
}

int Partition(int *array, int begin, int end, int pivotIndex)
{
int pivotValue = array[pivotIndex];
Swaparray(array[pivotIndex], array[end]);
int storeIndex = begin;
for( int i = begin; i < end; ++i)
{   if(array[i]  <=  pivotValue)
{  Swaparray(array[i], array[storeIndex]);
storeIndex++;
}
}

Swaparray(array[storeIndex], array[end]);
return storeIndex;
}

void Quicksortnum(int * array, int begin, int end)
{
if(end > begin)
{
int pivotIndex = begin;
int pivotNewIndex =  Partition(array,begin,end,pivotIndex);
Quicksortnum(array,begin, pivotNewIndex -1);
Quicksortnum(array,pivotNewIndex + 1, end);
}

}```
my log is
Compiling: C:\Documents and Settings\justin\My Documents\Quicksort.c
C:\Documents and Settings\justin\My Documents\Quicksort.c: In function `int main()':
C:\Documents and Settings\justin\My Documents\Quicksort.c:20: error: cannot convert `int (*)[10]' to `int*' for argument `1' to `void Quicksortnum(int*, int, int)'
C:\Documents and Settings\justin\My Documents\Quicksort.c:72:2: warning: no newline at end of file
Process terminated with status 1 (0 minutes, 0 seconds)

2. Code:
`  Quicksortnum(&numbers, 0, 10);`
Drop the '&'. Arrays are always passed as if they were a pointer to the first element.

Also, add a newline at the end of the file.

3. hey thanks, for point out my error heh

4. i have a new problem now seen i changed the program in which run time i get an error code
Code:
```#include<stdio.h>

void Swaparray( int  *array1, int *array2);
int Partition(int *array, int begin, int end, int pivotIndex);
void Quicksortnum(int *array, int begin, int end);

int main(void)
{
int numbers[10];
int i;
for(  i = 0; i < 10; ++ i)
{
printf("Enter a number: ");
scanf("%d", &numbers[i] );
}

Quicksortnum(numbers, 0, 10);

for( i = 0; i < 10; ++i)
{
printf(" array[%d] = %d",i,numbers[i]);

}

getchar();

return 0;

}

void Swaparray( int *array1, int  *array2)
{
int temp = *array1;
*array1 = *array2;
*array2 =  temp;
}

int Partition(int *array, int begin, int end, int pivotIndex)
{
int pivotValue = array[pivotIndex];
Swaparray(array[pivotIndex], array[end]);
int storeIndex = begin;
int i;
for(  i = begin; i < end; ++i)
{   if(array[i]  <=  pivotValue)
{  Swaparray(array[i], array[storeIndex]);
storeIndex++;
}
}

Swaparray(array[storeIndex], array[end]);
return storeIndex;
}

void Quicksortnum(int * array, int begin, int end)
{
if(end > begin)
{
int pivotIndex = begin;
int pivotNewIndex =  Partition(array,begin,end,pivotIndex);
Quicksortnum(array,begin, pivotNewIndex -1);
Quicksortnum(array,pivotNewIndex + 1, end);
}

}```

5. I think it would help if you swapped correctly. Call your swap with pointer arguments. This means that you have to take the address of array elements. Such as in this line:

Swaparray(&array[i], &array[storeIndex]);

Other than that, I'm not sure. You're going to have to be a little more specific from now on.