title: How do you remove a vector? c++
body: <p>I currently have a zombies project that I've been given for uni but I'm stuck on a couple of things.</p>
  
  <p>How to properly remove a vector? We have zombies and pill objects that are stored in vectors. My first thought was to change the symbol but obviously that doesn't work since that's all I was changing like this:</p>
  
  <pre><code>for (int i = 0; i &lt; MAXPILLS; i++)
  {
      //if pill coordinates = spot coordinates
      if ((pills.at(i).y == sp.y) &amp;&amp; (pills.at(i).x == sp.x))
      {
          pills.at(i).symbol = TUNNEL;    //make pill a tunnel
      }
  }
  </code></pre>
  
  <p>This pill object needs to be completely removed instead. I have to do this also for when a zombie falls down a hole (<code>sp</code> is an instance of the zombie class).</p>
  
  <p>How can I remove it all together?</p>