Function does not work. What to do?

void swap(int *a,int *b){
 int temp=*a;
*a=*b;
*b=temp;
}
int parent(int i){
 return (i-1)/2;
}
void shitf_up(binary_tree *s,int pos){
 int Parent=Parent(pos);
 if (pos>0 && (s->val[pos] > s->val[Parent])){
swap(&s->val[pos],&s->val[Parent]);
shitf_up(&s,Parent);
}
return;
}

Guys,I cannot shift_up. I can throw ideas why is not working. Thanks in advance.
April 7th 20 at 15:35
1 answer
April 7th 20 at 15:37
Solution
I have yet to see...
shitf_up(s,Parent);

Maybe even you mess up your pile, but a piece of code that is not visible.
Thanks for the reply,helped. And can you explain why not shitf_up(&s,Parent); - Weldon.Mayer commented on April 7th 20 at 15:40
Because s and so a pointer. - Claudine_Marvin46 commented on April 7th 20 at 15:43
@michel.Swift44,
A unary operation & turns a variable into a pointer to it. So &s will make the pointer a pointer to a pointer. - Claudine_Marvin46 commented on April 7th 20 at 15:46

Find more questions by tags C