title: C++ Vector datatype compiler error issue with a member of my defined Class
body: <p>I'm trying to learn C++ as an interest, and I'm coming up with an issue trying to incorporate a Vector container.</p>
  
  <p>Could anyone help me, I'm trying to incorporate a vector iterator into my Class, but I'm getting a compile error on this line <code>std::cout &lt;&lt; nodeIterator-&gt;data;</code>, my code snippets below.</p>
  
  <p>Error I'm getting:</p>
  
  <blockquote>error: request for member 'data' in '* nodeIterator. __gnu_cxx::__normal_iterator::operator-> [with _Iterator = const FibTree::Node**, _Container = std::vector >]()', which is of non-class type 'const FibTree::Node*'</blockquote>
  
  <pre><code>class Node {
      public:
          int data;
          Node const* left;
          Node const* right;
          Node const* parent;
          int n;
          int level;
          int index;
  
          Node (void);
  
  };
  
  // Get root method
  Node const* getRoot(void) {
      return this-&gt;root;
  }
  
  void start(Node const* root) {
      std::vector&lt;Node const*&gt; setsList;
      std::cout &lt;&lt; root-&gt;data; 
  writeSets(setsList, root);
  }
  
  writeSets(std::vector&lt;Node const*&gt; &amp;setsList, Node const* cur) {
  
      std::vector&lt;Node const*&gt;::iterator nodeIterator;
  
      // Displays all preceding left values
      for (nodeIterator = setsList.begin();nodeIterator != setsList.end(); nodeIterator++)
      {
          std::cout &lt;&lt; nodeIterator-&gt;data; //*** Get Compile error this line ***
      }
  
      std::cout &lt;&lt; cur-&gt;left-&gt;data;
      std::cout &lt;&lt; cur-&gt;right-&gt;data;
  
      setsList.push_back(cur-&gt;left);
      writeSets(setsList,cur-&gt;right);
      setsList.pop_back();
  }
  </code></pre>
  
  <p>Could anyone give me any suggestions?</p>
  
  <p>Many thanks</p>