title: binary tree insertion
body: <p>In the following code i am getting compilation error:c2227:left of -> left must point to class/struct/union/generic type. any help how to fix this; I am trying to insert in a binary tree.</p>
  
  <pre><code>typedef struct bnode{
          int key;
          struct bnode* left;
          struct bnode* right;
          }BNODE;
  
  void printKeysReverse(BNODE* current);
  void inorder(BNODE* current);
  void insert(BNODE **root,int key);
  int main(void){
      BNODE* root=NULL;
  
      insert(&amp;root,27);
      insert(&amp;root,59);
      insert(&amp;root,21);
      insert(&amp;root,38);
      insert(&amp;root,54);
      insert(&amp;root,63);
      insert(&amp;root,8);
      insert(&amp;root,70);
      insert(&amp;root,15);
  
  }
  void insert(BNODE **root, int val){
    BNODE *newnode;
  
    newnode=(BNODE*)malloc(sizeof(BNODE));        
    newnode-&gt;right=NULL;
    newnode-&gt;left=NULL;
  
    if ((*root)==NULL){
         *root=newnode;
         (*root)-&gt;key=val;              
         return;
         }
    if (val&lt;(*root)-&gt;key) insert((&amp;root)-&gt;left,val);
    else insert((&amp;root)-&gt;right,val);     
  }//end 
  </code></pre>