title: Iterating through a vector of pointers
body: <p>I'm trying to iterate through a Players hand of cards.</p>
  <pre><code>#include &lt;vector&gt;
  #include &lt;iostream&gt;
  
  class Card {
    int card_colour, card_type;
  public:
    std::string display_card();
  };
  
  std::string Card::display_card(){
    std::stringstream s_card_details;
    s_card_details &lt;&lt; &quot;Colour: &quot; &lt;&lt; card_colour &lt;&lt; &quot;\n&quot;;
    s_card_details &lt;&lt; &quot;Type: &quot; &lt;&lt; card_type &lt;&lt; &quot;\n&quot;;
      
    return s_card_details.str();
  }
  
  int main() 
  {
    std::vector&lt;Card*&gt;current_cards;
    vector&lt;Card*&gt;::iterator iter;
    for(iter = current_cards.begin(); iter != current_cards.end(); iter++) 
    {
      std::cout &lt;&lt; iter-&gt;display_card() &lt;&lt; std::endl;
    }
  }
  </code></pre>
  <p>This line</p>
  <pre><code>std::cout &lt;&lt; iter-&gt;display_card() &lt;&lt; std::endl;
  </code></pre>
  <p>currently comes up with the</p>
  <blockquote>
  <p>error: Expression must have pointer-to-class type.</p>
  </blockquote>
  <p>How can I fix this?</p>