Hi, i am making a heap sort program using a struct known as Date, anyhow i am getting an error in two lines that i cant figure out how to solve...
void dahHeap(Date a[], int i){
int n = sizeof(a);
int lefty = 2 * i;
int righty = 2 * i + 1;
int max = 0;
if (lefty <= n && a[lefty] > a[i]) //error
max = lefty;
else
max = i;
if ((righty <= n) && (a[righty] > a[max])) //error
max = righty;
if (max != 1){
Date temp = a[i];
a[i] = a[max];
a[max] = temp;
dahHeap (a, max);
}
}
i am encountering the same error in lines 6 and 10, i have tried moving around parenthesis as you can see in the differences of the code. Thank you for any of your help.