c - Passing global pointer to function -


i declare global struct word *root = null; populate using pthread calls(created bst) , when go print out inorder traversal function calling inorder(word *root), gives me error saying "unexpected type name 'word': expected expression". don't understand doing wrong.

void ordered(word *root); // declaring function //code// word *root = null; // declare global pointer root  /*main*/ //code work , creates bst root  ordered(word *root); //call function 

follow these rules:

  • you must specify variable type when declare function
  • you may specify variable name when declare function
  • you must not specify variable type when call function

in example, variable type word* , variable name root.

so change this:

ordered(word *root); //call function 

to this:

ordered(root); //call function 

Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -