title: Calling member functions of objects vector
body: <p>So I have a vector declared like so:</p>
  
  <pre><code>vector &lt;Game *&gt; games;
  </code></pre>
  
  <p>and I have a function in the <code>Game</code> class like so:</p>
  
  <pre><code>public:
  
      // Rest of .h
  
      void hello(){
          cout &lt;&lt; "hello" &lt;&lt; endl;
      }
  </code></pre>
  
  <p>and I'm trying to iterate over my <code>games</code> vector using an iterator, and call the <code>hello()</code> function each time:</p>
  
  <pre><code>vector &lt;Game *&gt;::const_iterator it_games = games.begin();
  
  for (it_games = games.begin(); it_games != games.end(); it_games++) {
      *it_games-&gt;hello();
  }
  </code></pre>
  
  <p>but I keep getting this error when I try to compile: </p>
  
  <pre><code>main.cpp: In function ‘void summary(std::vector&lt;Game*, std::allocator&lt;Game*&gt; &gt;, std::string, std::string, std::string, std::string)’:
  main.cpp:56: error: request for member ‘hello’ in ‘* it_games. __gnu_cxx::__normal_iterator&lt;_Iterator, _Container&gt;::operator-&gt; [with _Iterator = Game* const*, _Container = std::vector&lt;Game*, std::allocator&lt;Game*&gt; &gt;]()’, which is of non-class type ‘Game* const’
  </code></pre>
  
  <p>Any idea what's going on/how I can get my desired functionality?</p>