Unable to save objects to a vector c++
<pre><code>            Sprite1 *enemy = new Sprite1(100, 100, "enemy.bmp", *screen);
            enemy-&gt;DrawJon(screen);

            enemyList.insert(enemyList.end(), *enemy);
</code></pre>

<p>For some reason, the enemy is not being stored in the list. Any ideas?</p>

<h1>EDIT:</h1>

<p>Also how to access the objects and use them after wards like:</p>

<pre><code>for (int g=0; g&lt;enemyList.size(); g++)
            {
                Sprite1 enemyToMove = enemyList.at(g); //.at(g);
                enemyToMove.MoveJon(0, 50, screen);
            }
</code></pre>

<h1>EDIT:</h1>

<p>So even though this got closed I still want people to know what the solution was. I had not made a constructor that set the properties on the class. In the end I was able to get this working with a default constructor and a setter method</p>
