title: Converting subclass to base class?
body: <p>I am working on a problem in which we have a binary search tree made of nodes.  The node's attributes consist of string, pointer to left node, and pointer to right node.  I have a class called TransactionNode that is a subclass of node.  TransactionNode has an int (for amount sold) as well as the same attributes from node class.  I have a function called findBiggest that looks for the highest amount sold from TransactionNode and returns a reference to that TransactionNode.  My problem is how do I convert something that is from the node class to TransactionNode? (I am avoiding changing the nodes in the binary search tree to TransactionNodes)</p>
  
  <pre><code>TransactionNode &amp; BST::findBiggest()
  {
      TransactionNode * rightSide;
      rightSide = this-&gt;mpRoot;
  
      while (rightSide != nullptr)
          {``
             //find biggest transaction
          }
  
       return rightSide;
  
     }
  </code></pre>