0

i have a program using two functions one is to insert a new node in a binary tree and the other is to print all leaves

the errors are:

In file included from tree.c:4: tree.h:4: error: expected ‘)’ before ‘*’ token

tree.h:5: error: expected ‘)’ before ‘*’ token

tree.c:8: error: expected ‘)’ before ‘*’ token

tree.c:28: error: expected ‘)’ before ‘’ token make: ** [tree.o] Error 1

line 4 &5

void insert(fyllo **root,int newnum);

void print_inorder(fyllo *last);

line 8 and under

void insert(fyllo **riza,int newnum){

 fyllo *neofyllo;

  neofyllo=ALLOC(fyllo);        

  neofyllo->right=NULL;

  neofyllo->left=NULL;

  if ((*riza)==NULL){
       *riza=neofyllo;
       (*riza)->num=newnum;              
       return;
       }
  if (newnum<(*riza)->newnum) insert(&(*riza)->left,newnum);
  else insert(&(*riza)->right,newnum);    
     }

line 28 and under

void print_inorder(fyllo *riza){

     if (riza==NULL) return ;
     inorder(riza->left);
     printf("%d ",riza->num);
     inorder(riza->right);
    }
0

1 Answer 1

4

The compiler seems to have trouble with the fyllo type, make sure it is declared correctly.

Sign up to request clarification or add additional context in comments.

2 Comments

it was right in front of me but i was stack and couldnt see the problem,thanks a lot!!
@user501986: Click on the arrow-up and the checkmark besides this answer, then. The arrow-up is to reward helpful answers, the checkmark to reward "The Right Answer".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.