title: Template with struct
body: <p>I am designing a Binary Search Tree which allows user to enter value of any data-type, not just <strong>int</strong>.<br />To achieve this,i am trying to use template with a struct.
  I defined my struct as follows</p>
  
  <pre><code>template &lt;class T&gt;
  struct node
  {
      struct node *left;
      T info;
      struct node *right;
  }*root;
  </code></pre>
  
  <p>Now i am trying use this in a class called BST(binary search Tree)</p>
  
  <pre><code>template &lt;class T&gt;
  class bst
  {
      public: 
      void insert(node *,node *);
      void inorder(node *);
  };
  </code></pre>
  
  <p>But the compiler is throwing the error,
  <strong>template declaration of 'node&lt; T >* root'</strong>.<br />
  How can i use template with struct variables ?</p>