title: constructor makes the object but doesn't assign values to it
body: <p>I'm writing a binary search tree to hold the values of polynomial. The only problem that I have is making a leaf with 2 parameter ( coefficient , power of the x).</p>
  
  <pre><code>    tree newTree(5,2)    ;5(x^2)
      tree anothertree()   ;it works then I can insert leaf into the root
  </code></pre>
  
  <p>constructor makes the root but it is empty when I want to print the tree. </p>
  
  <p>this is my constructor that accept 2 values to make a Node for a tree. </p>
  
  <pre><code>tree::tree(const int&amp; c,const int&amp; x)
  {
      treeNode* root = new treeNode(c,x);
  }
  </code></pre>
  
  <p>this is the Node struct that I use to make the Nodes for the tree.</p>
  
  <pre><code>        struct treeNode
         {
          int x;
          int coef;
          treeNode* left;
          treeNode* right;
          treeNode()
          {
              this-&gt;x=0;
              this-&gt;coef=0;
              this-&gt;left=nullptr;
              this-&gt;right=nullptr;
          }
          treeNode(const int&amp; c,const int&amp; x)
          {
              this-&gt;x = x;
              this-&gt;coef = c;
              left = nullptr;
              right = nullptr;
          }
      };
  </code></pre>
  
  <p>this is the class that I am working on:</p>
  
  <pre><code> class tree{
      private:
      treeNode* root;
       void postorder(treeNode* p);
       void inorder(treeNode* p);
       void preorder(treeNode* p);
       void destroyTree(treeNode* p);
       void copyTree(treeNode* original,treeNode* &amp;copycat);
  
  public:
      tree();
      tree(const int&amp; c,const int&amp; x);
      tree(const tree&amp; myTree);
      ~tree();
      void insert(int c,int xval);
      const tree &amp; operator=(const tree &amp;myTree);
      void print_postorder();
      void print_inorder();
      void print_preorder();
   };
  </code></pre>