Hey im trying to make a quick sort function with pointers, im pretty limited in pointer knowledge. I'm receiving a segmentation-fault for the code, I know that means im trying to map values outside of my array range but i cant seem to solve the issue. Any help would be appreciated! Even if you don't want to answer it pointing me in the right direction is always appreciated!
I do have a main function where this is called and it is initialized.
#include <stdio.h>
#include <time.h>
#include <math.h>
#include<ctype.h>
#include <stdlib.h>
#include <stdbool.h>
void quicksort_time(int *first,int *last){
int *pivot,*j,*temp,*i;
// The Quick Sorting algorithim is below!
if(first<last){
*pivot=*first;
*i=*first;
*j=*last;
while(i<j){
while(i<=pivot&&i<last)
i++;
while(j>pivot)
j--;
if(i<j){
*temp=*i;
*i=*j;
*j=*temp;
}
}
*temp=*pivot;
*pivot=*j;
*j=*temp;
quicksort_time(first,j-1);
quicksort_time(j+1,last);
}
}
