title: Error: "Function" not declared in this scope
body: <p>I think this error is telling me that my insert function is not declared however as far as I can tell I have it declared correctly and it is in the public portion of my class so I think I should be able to use it in my main function. I'm trying to call it as just <code>insert(12);</code> however it's giving me Error: 'insert' was not declared in this scope.</p>
  
  <pre><code>class BST
  {
      public:
          BST();
          BST(int* arr, int size);
          void insert(int val);
          void inOrderTraversal();
          void inOrderTraversal(node * Root);
  
      private:
          node * Root;
  
  };
  
  void BST::insert(int val) 
  {
      node* temp = new node();
      temp-&gt;value = val;
  
      if(Root == NULL) {
          Root = temp;
          return;
      }
  
      node* current;
      current = Root;
      node* parent;
      parent = Root;
      current = (temp-&gt;value &lt; current-&gt;value) ? (current-&gt;Left) : (current-&gt;Right);
  
      while(current != NULL) 
      {
          parent = current;
          current = (temp-&gt;value &lt; current-&gt;value) ? (current-&gt;Left) : (current-&gt;Right);
      }
  
      if(temp-&gt;value &lt; parent-&gt;value) {
          parent-&gt;Left = temp;
      }
  
      if(temp-&gt;value &gt; parent-&gt;value) {
          parent-&gt;Right = temp;
      }
  }
  </code></pre>