title: Expected type-specifier before ')' token c++
body: <p>I am trying to overload the "&lt;&lt;" operator to print out a structure I made. The structure is a hashed array tree. I have a "HashNode" class that performs all the operations on nodes of a hash tree and I overload the operator in the class. I have a MLH class which instantiates a single HashNode. Here is the relevant code:</p>
  
  <p>HashNode.cpp</p>
  
  <pre><code>template &lt;typename T&gt;
  ostream &amp;operator &lt;&lt; ( ostream &amp;output, const HashNode&lt;T&gt; &amp;node ) {
    if(node.stemNode == 0){
      //leaf node                                                                               
      for(int i=0; i &lt; node.numElements; i++) {
        output &lt;&lt; "\n-------------------------------------------" &lt;&lt; endl;
        output &lt;&lt; "This Node's Level: " &lt;&lt; node.nodeLevel &lt;&lt; endl;
        output &lt;&lt; "\nKey: " &lt;&lt; node.keyArray[i] &lt;&lt; endl;
        output &lt;&lt; "\nData: " &lt;&lt; *(node.dataArray[i])  &lt;&lt; endl;
      }
      output &lt;&lt; "\n\n";
    }else if (node.stemNode == 1) {
      //stem node                                                                               
      for(int j=0; j&lt;5; j++) {
        if(node.childArray[j] != NULL) {
          output &lt;&lt; *(node.childArray[j]);
          // levelCtr++;                                                                   
        }
      }
    }
    int lowest;
    int ctr = 0;
    for(int i = 8; i&gt;=0; i--) {
      if(levels[i]==0) {
        ctr++;
      }
    }
    lowest = 9-(ctr+1);
    if(node.nodeLevel == 0) {
      output &lt;&lt; "\n\nLowest Level: " &lt;&lt; (9-(ctr+1)) &lt;&lt; endl;
    }
    return output; //&lt;&lt; "\n\nLowest Level: " &lt;&lt; lowest &lt;&lt;   endl;                                   
  }
  </code></pre>
  
  <p>MLH.cpp</p>
  
  <pre><code>template &lt;typename T&gt;
  ostream &amp;operator &lt;&lt; (ostream &amp;output, const MLH&lt;T&gt; &amp;tree)
  {
    //HashNode&lt;T&gt; ptr = tree;                                                       
    output &lt;&lt; *(tree-&gt;proot-&gt;operator);
    return output;
  }
  </code></pre>
  
  <p>For some reason, I get the following error when trying to compile:</p>
  
  <pre><code>g++ -c -g Hashtest.cpp
  In file included from Hashtest.cpp:2:0:
  MLH.h: In function ‘std::ostream&amp; operator&lt;&lt;(std::ostream&amp;, const MLH&lt;T&gt;&amp;)’:
  MLH.h:69:36: error: expected type-specifier before ‘)’ token
  output &lt;&lt; *(tree-&gt;proot-&gt;operator);
                               ^
  make: *** [Hashtest.o] Error 1
  </code></pre>
  
  <p>If I am returning the output stream from the HashNode class to the output stream in the MLH class, why is there an issue? Thanks for the help and I apologize for any formatting issues.</p>
  
  <p>EDIT: I should have specified that "proot" is an attribute of an MLH object. It is a pointer to a HashNode object. By saying "tree->proot->operator", I am trying to call the overloading operator function in the HashNode class. </p>