title: Problems with pointers
body: <p>I have a Binary Search Tree that I'm making and I implemented the Insert node code as follows:</p>
  
  <pre><code>BSTNode * BST::Insert(const std::string &amp; v){
      BSTNode * node = new BSTNode(v);
      if (root == NULL){
          root = node;
      } else if (root-&gt;value.compare(v) &gt; 0) {
          Insert(root-&gt;left, node);
          //recursive insert the method
      } else if (root-&gt;value.compare(v) &lt; 0) {
          Insert(root-&gt;right, node);
      } else {
          delete node;
          return NULL;
      }
      size++;
      return node;
  }
  </code></pre>
  
  <p>Followed by the recursive insert method in my header file (it has private access):</p>
  
  <pre><code>void Insert(BSTNode* current, BSTNode* node){
      if (current == NULL){
          current = node;
      } else if (current-&gt;value == node-&gt;value){
          delete node;
      } else if (current-&gt;value &lt; node-&gt;value) {
          Insert(current-&gt;left, node);
      } else if (current-&gt;value &gt; node-&gt;value){//if (parent-&gt;value &lt; node-&gt;value) {
          Insert(current-&gt;right, node);
      }
  }
  </code></pre>
  
  <p>When the recursive function sets the pointer and then returns, the changes I made to the pointer DON'T stay.</p>