Problem with my method in C++
<p>I have a class like so:</p>

<pre><code>class Qtree
{
public:
    Qtree();
    Qtree(BMP img, int d);
private:
   class QtreeNode
   {
   public:
      QtreeNode* nwChild;  // pointer to northwest child
      QtreeNode* neChild;  // pointer to northeast child
      QtreeNode* swChild;  // pointer to southwest child
      QtreeNode* seChild;  // pointer to southeast child
      RGBApixel element;  // the pixel stored as this node's "data"

      QtreeNode();
      QuadtreeNode copy(QuadtreeNode &amp; n);

   };
</code></pre>

<p>And so the question is on the copy method. It makes a copy of a given node and returns it. </p>

<pre><code>QtreeNode Qtree::QtreeNode::copy(QtreeNode &amp; n) {
   QtreeNode *newNode;
   //....
   return newNode;
}
</code></pre>

<p>And then I call copy from my Qtree copy constructor:</p>

<pre><code>root=QtreeNode::copy(*tree.root); //each tree has a root pointer
//have also tried many different things here, but dont really know what to put
</code></pre>

<p>I get the following errors:</p>

<pre><code>error: cannot call member function ‘Qtree::QtreeNode* Qtree::QtreeNode::copy(Qtree::QtreeNode&amp;)’ without object

and

error: no matching function for call to ‘copy(Qtree::QtreeNode&amp;)’
</code></pre>
