Create objects while adding them into vector
<p>everyone. I'll try to explain what do I want to do. I hope, my english is good enough to do that.
I have a vector. I want the vector to hold some objects. I don't know how many objects will the vector contain (user will decide).
For testing I searched a little and created code below. It's working just fine, by the way. It does what I want.</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;
using namespace std;

class testObject{
private:
   int someInt;
public:
   testObject(int a){ someInt=a; }
   void show() { cout&lt;&lt;someInt&lt;&lt;endl; }
};

int main()
{
    vector&lt;testObject&gt; testVector;
    cout &lt;&lt; "Initial size: " &lt;&lt; testVector.size() &lt;&lt;endl;

    for ( int i = 0; i &lt; 3; i++ )
    testVector.push_back(testObject(3));
    cout &lt;&lt; "New size:     " &lt;&lt; testVector.size() &lt;&lt;endl;

    for ( int j = 0; j &lt; 3; j++ )
    testVector[ j ].show();

    system("pause");
}    
</code></pre>

<p>But here's another sample of code that looks the same but it's not working.</p>

<pre><code>void Dealer::setNumberOfPlayers( const int tNumber )
{
    for ( int i = 0; i &lt; tNumber; i++ )
        vectorOfGamers.push_back(Player); // Player is a class that I created
}
</code></pre>

<p>Visual Studio 2012 writes "Error: type name is not allowed"</p>

<p>And I have another question.
I have abstract class Gamer. Also, I have classes: Dealer, Bot, Player. These 3 classes derives from Gamer. Can I create vector to hold objects of Dealer, Bot and Player at the same time? How do I do that? As I know, all objects in vector should be of one type.</p>

<p>Thank you for help!</p>
