I need to create many instances of a class which I feel a vector would do as I need. I've read that a vector only stores a copy which isn't what I want as I need to be able to access and compute within the class. I've tried storing the pointer but it isn't working out either.

**Tower.cpp**

```
vector<Projectile*> projectiles;

void Tower::fire(Minion& m)
{
    projectiles.push_back(&Projectile(&m, x, 2, y));
}

void Tower::update(Level& level)
{
    for (int i = 0; i < projectiles.size(); i++)
    {
        projectiles.at(i)->update();
    }
}

```

**Projectile.cpp**

```
Minion* m;

void Projectile::update()
{
    float angle = atan((m->getX() - x) / (m->getY() - z));
    x += speed * sin(angle);
    z += speed * cos(angle);
}

```