title: call to non-static member function without an object argument, C++ nodes
body: <p>This appears to be covered in depth on this website but after searching for a while I can't seem to find what my problem specifically is, as I'm getting the error with a void function.</p>
  
  <p>I'm attempting to code a Huffman Tree and I'm trying to build a min heap. In order to do that I need to be able to swap nodes in the tree. I keep receiving the above error on the line where I call swapNode for the first time.</p>
  
  <p>Node.cpp offending code</p>
  
  <pre><code>void Node::swapNode(Node &amp;a, Node &amp;b) {
      Node t = a;
      a = b;
      b = t;
  }
  Node**minHeapify(Node **array, int index) { 
      int root = index;
      int left = 2 * index + 1;
      int right = 2 * index + 2;
      if (array[left]-&gt;frequency &lt; array[root]-&gt;frequency) {
          root = left;
      }
      if (array[right]-&gt;frequency &lt; array[root]-&gt;frequency) {
          root = right;
      } 
      if(root != index) {
          Node::swapNode(&amp;array[root], &amp;array[index]);
          minHeapify(array, root);
      }
  }
  </code></pre>
  
  <p>Node.h</p>
  
  <pre><code>#ifndef _listnode_h
  #define _listnode_h
  
  #include &lt;string&gt;
  
  class Node {
      public: 
          Node(char character, int frequency, int ascii);
          Node(int frequency);
          Node();
          ~Node();
          int getFrequency();
          char getCharacter();
          std::string getCode();
          Node *getLeft();
          Node *getRight();
          Node **minHeapify(Node *, int);
          void swapNode(Node &amp;a, Node &amp;b);    
          void setCode(std::string s);
  
  //  private:
          int frequency;
          char character; 
          int ascii;
          std::string code;
          int leaf = 0;
          Node* left, *right; 
  };
  
  #endif 
  </code></pre>
  
  <p>The array I'm passing in is an array of tree nodes that I want to sort into a min heap. Any and all help is appreciated, thanks.</p>