title: How to call different overridden methods on a vector
body: <p>i'm using vector for the first time in c++ and my problem is to call different overridden methods, let me explain: I got the CARD class subclassed by SPECIALCARD. In CARD there is a method printCard() and in SPECIALCARD the method is overridden. 
  Then in the main i create a vector of Card. I put in the first position a card and in the second position a specialcard. When i try to call the printCard() method on the first and the second position it always run the method of the parent (but i want to call the parent method in first position and the son method in the second position).
  Here is the Card class:</p>
  
  <pre><code>CARD.H
  using namespace std;
  
  class Card
  {
      public:
          Card(int number, string seed);
          virtual void printCard();
  
      protected:
          int number;
          string seed;
  };
  
  CARD.CPP
  #include "Card.h"
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  Card::Card(int number, string seed)
  {
     this-&gt;number = number;
     this-&gt;seed = seed;
  }
  
  void Card::printCard()
  {
      cout &lt;&lt; "the card is " &lt;&lt; number &lt;&lt; " of " &lt;&lt; seed &lt;&lt; endl; 
  }
  </code></pre>
  
  <p>And here is the SpecialCard class</p>
  
  <pre><code>SPECIALCARD.H
  #include "Card.h"
  #include &lt;string&gt;
  using namespace std;
  
  class Special_Card : public Card
  {
      public:
          Special_Card(int number, string name, string seed);
          string getName();
          virtual void printCard();
  
      private:
          string name;
  };
  
  SPECIALCARD.CPP
  #include &lt;iostream&gt;
  #include "Special_Card.h"
  #include "Card.h"
  #include &lt;string&gt;
  using namespace std;
  
  Special_Card::Special_Card(int number, string name, string seed): Card(number, seed)
  {
      this-&gt;number = number;
      this-&gt;name = name;
      this-&gt;seed = seed;
  }
  
  //overridden method
  void Special_Card::printCard()
  {
      cout &lt;&lt; "the card is " &lt;&lt; name &lt;&lt; " of " &lt;&lt; seed &lt;&lt; endl;
  }
  </code></pre>
  
  <p>finally we got the main where i create the vector</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "Card.h"
  #include "Special_Card.h"
  #include &lt;string&gt;
  #include &lt;vector&gt;
  using namespace std;
  
  int main()
  {
      vector &lt;Card&gt; deck;
      deck.push_back(Card(1,"hearts"));
      deck.push_back(Special_Card(10,"J","hearts"));
      deck[0].printCard();
      deck[1].printCard();
  }
  </code></pre>
  
  <p>The console output is 
  the card is 1 of hearts /n
  the card is 10 of hearts (in the second i want to print "the card is a J of hearts")</p>